[PM-27045] Explicitly specify unlock method (#2047)

This commit is contained in:
Katherine Bertelsen 2025-10-16 15:54:28 -05:00 committed by GitHub
parent d8b5dc94d8
commit 6c9d2e9f22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 15 deletions

View File

@ -217,9 +217,9 @@ struct SettingsView: View {
private func biometricsToggleText(_ biometryType: BiometricAuthenticationType) -> String { private func biometricsToggleText(_ biometryType: BiometricAuthenticationType) -> String {
switch biometryType { switch biometryType {
case .faceID: case .faceID:
Localizations.unlockWith(Localizations.faceID) Localizations.unlockWithFaceID
case .touchID: case .touchID:
Localizations.unlockWith(Localizations.touchID) Localizations.unlockWithTouchID
} }
} }

View File

@ -182,9 +182,11 @@
"SyncVaultNow" = "Sync vault now"; "SyncVaultNow" = "Sync vault now";
"TouchID" = "Touch ID"; "TouchID" = "Touch ID";
"TwoStepLogin" = "Two-step login"; "TwoStepLogin" = "Two-step login";
"UnlockWith" = "Unlock with %1$@"; "UnlockWithBiometrics" = "Unlock with biometrics";
"UnlockWithFaceID" = "Unlock with Face ID";
"UnlockWithTouchID" = "Unlock with Touch ID";
"UnlockWithOpticID" = "Unlock with Optic ID";
"UnlockWithPIN" = "Unlock with PIN code"; "UnlockWithPIN" = "Unlock with PIN code";
"UnlockWithUnknownBiometrics" = "Unlock with biometrics";
"Validating" = "Validating"; "Validating" = "Validating";
"VerificationCode" = "Verification code"; "VerificationCode" = "Verification code";
"ViewItem" = "View item"; "ViewItem" = "View item";

View File

@ -61,13 +61,13 @@ struct VaultUnlockSetupState: Equatable {
case let .biometrics(type): case let .biometrics(type):
switch type { switch type {
case .faceID: case .faceID:
Localizations.unlockWith(Localizations.faceID) Localizations.unlockWithFaceID
case .opticID: case .opticID:
Localizations.unlockWith(Localizations.opticID) Localizations.unlockWithOpticID
case .touchID: case .touchID:
Localizations.unlockWith(Localizations.touchID) Localizations.unlockWithTouchID
case .unknown: case .unknown:
Localizations.unlockWithUnknownBiometrics Localizations.unlockWithBiometrics
} }
case .pin: case .pin:
Localizations.unlockWithPIN Localizations.unlockWithPIN

View File

@ -104,11 +104,11 @@ class AccountSecurityViewTests: BitwardenTestCase {
func test_biometricsToggle() throws { func test_biometricsToggle() throws {
processor.state.biometricUnlockStatus = .available(.faceID, enabled: false) processor.state.biometricUnlockStatus = .available(.faceID, enabled: false)
_ = try subject.inspect().find( _ = try subject.inspect().find(
toggleWithAccessibilityLabel: Localizations.unlockWith(Localizations.faceID), toggleWithAccessibilityLabel: Localizations.unlockWithFaceID,
) )
processor.state.biometricUnlockStatus = .available(.touchID, enabled: true) processor.state.biometricUnlockStatus = .available(.touchID, enabled: true)
_ = try subject.inspect().find( _ = try subject.inspect().find(
toggleWithAccessibilityLabel: Localizations.unlockWith(Localizations.touchID), toggleWithAccessibilityLabel: Localizations.unlockWithTouchID,
) )
} }
@ -118,7 +118,7 @@ class AccountSecurityViewTests: BitwardenTestCase {
processor.state.biometricUnlockStatus = .notAvailable processor.state.biometricUnlockStatus = .notAvailable
XCTAssertNil( XCTAssertNil(
try? subject.inspect().find( try? subject.inspect().find(
toggleWithAccessibilityLabel: Localizations.unlockWith(Localizations.faceID), toggleWithAccessibilityLabel: Localizations.unlockWithFaceID,
), ),
) )
} }

View File

@ -255,13 +255,13 @@ struct AccountSecurityView: View {
private func biometricsToggleText(_ biometryType: BiometricAuthenticationType) -> String { private func biometricsToggleText(_ biometryType: BiometricAuthenticationType) -> String {
switch biometryType { switch biometryType {
case .faceID: case .faceID:
Localizations.unlockWith(Localizations.faceID) Localizations.unlockWithFaceID
case .opticID: case .opticID:
Localizations.unlockWith(Localizations.opticID) Localizations.unlockWithOpticID
case .touchID: case .touchID:
Localizations.unlockWith(Localizations.touchID) Localizations.unlockWithTouchID
case .unknown: case .unknown:
Localizations.unlockWithUnknownBiometrics Localizations.unlockWithBiometrics
} }
} }
} }