From b2bc104f1467f1cd3ab25eed4eeb0a0c05d9e6d8 Mon Sep 17 00:00:00 2001 From: jubie-livefront Date: Fri, 15 Mar 2024 11:27:51 -0500 Subject: [PATCH] Adds email accessibility ID --- .../UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift | 5 ++--- .../UI/Auth/ProfileSwitcher/ProfileSwitcherRow.swift | 5 +++-- .../UI/Auth/ProfileSwitcher/ProfileSwitcherRowState.swift | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift index 8caf197b8..c20e041cc 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherHandler.swift @@ -135,9 +135,8 @@ private extension ProfileSwitcherHandler { /// func didLongPressProfileSwitcherItem(_ account: ProfileSwitcherItem) async { profileSwitcherState.isVisible = false - let hasNeverLock = await ( - try? profileServices.authRepository.sessionTimeoutValue(userId: account.userId) - ) == SessionTimeoutValue.never + let sessionTimeout = try? await profileServices.authRepository.sessionTimeoutValue(userId: account.userId) + let hasNeverLock = sessionTimeout == .never showAlert( .accountOptions( account, diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRow.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRow.swift index c605d9e6c..ec1b8015f 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRow.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRow.swift @@ -55,14 +55,15 @@ struct ProfileSwitcherRow: View { VStack(alignment: .leading, spacing: 0) { Text(title) .styleGuide(.body) + .accessibilityIdentifier("AccountEmailLabel") .foregroundColor(Asset.Colors.textPrimary.swiftUIColor) - .truncationMode(.tail) .lineLimit(1) + .truncationMode(.tail) if let subtitle { Text(subtitle) .styleGuide(.subheadline) - .foregroundColor(Asset.Colors.textSecondary.swiftUIColor) .accessibilityIdentifier("AccountStatusLabel") + .foregroundColor(Asset.Colors.textSecondary.swiftUIColor) } } Spacer() diff --git a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRowState.swift b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRowState.swift index e2a5507fb..b39b3d7ae 100644 --- a/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRowState.swift +++ b/BitwardenShared/UI/Auth/ProfileSwitcher/ProfileSwitcherRowState.swift @@ -12,7 +12,7 @@ struct ProfileSwitcherRowState: Equatable { /// /// - Parameters: /// - ProfileSwitcherItem: The profile switcher item. - /// - showDivider: a flag for toggling divider visibility, defaults to true + /// - showDivider: A flag for toggling divider visibility, defaults to true /// case active(ProfileSwitcherItem)