Merge pull request #407 from mpretty-cyro/fix/display-name-accessibility-ids

Updated a few accessibility ids for automated tests
pull/1061/head
Morgan Pretty 3 days ago committed by GitHub
commit 5bb006b202
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -227,8 +227,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
icon: .close,
tintColor: .messageBubble_outgoingText,
backgroundColor: .primary,
accessibility: Accessibility(label: "Outdated client banner"),
labelAccessibility: Accessibility(label: "Outdated client banner text"),
labelAccessibility: Accessibility(identifier: "Outdated client banner"),
height: 40,
onTap: { [weak self] in self?.removeOutdatedClientBanner() }
)
@ -246,7 +245,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
icon: .none,
tintColor: .messageBubble_outgoingText,
backgroundColor: .primary,
accessibility: Accessibility(label: "Legacy group banner"),
labelAccessibility: Accessibility(identifier: "Legacy group banner"),
height: nil,
onTap: { [weak self] in self?.openUrl(Features.legacyGroupDepricationUrl) }
)
@ -268,7 +267,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
icon: .none,
tintColor: .black,
backgroundColor: .explicitPrimary(.orange),
accessibility: Accessibility(label: "Expired group banner"),
labelAccessibility: Accessibility(identifier: "Expired group banner"),
height: nil
)
)
@ -290,15 +289,16 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
private lazy var emptyStateLabelContainer: UIView = {
let result: UIView = UIView()
result.addSubview(emptyStateLabel)
emptyStateLabel.pin(.top, to: .top, of: result)
emptyStateLabel.pin(.leading, to: .leading, of: result, withInset: Values.largeSpacing)
emptyStateLabel.pin(.trailing, to: .trailing, of: result, withInset: -Values.largeSpacing)
emptyStateLabel.pin(.bottom, to: .bottom, of: result)
return result
}()
private lazy var emptyStateLabel: UILabel = {
let result: UILabel = UILabel()
result.isAccessibilityElement = true
result.accessibilityIdentifier = "Control message"
result.translatesAutoresizingMaskIntoConstraints = false
result.font = .systemFont(ofSize: Values.verySmallFontSize)
@ -942,7 +942,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
self.viewModel.updateInteractionData(updatedData)
// Update the empty state
self.emptyStateLabel.isHidden = hasMessages
self.emptyStateLabelContainer.isHidden = hasMessages
UIView.performWithoutAnimation {
self.tableView.reloadData()
@ -954,7 +954,7 @@ final class ConversationVC: BaseVC, LibSessionRespondingViewController, Conversa
}
// Update the empty state
self.emptyStateLabel.isHidden = hasMessages
self.emptyStateLabelContainer.isHidden = hasMessages
// Update the ReactionListSheet (if one exists)
if let messageUpdates: [MessageViewModel] = updatedData.first(where: { $0.model == .messages })?.elements {

@ -660,7 +660,7 @@ class ThreadSettingsViewModel: SessionTableViewModel, NavigatableStateHolder, Ob
threadViewModel.threadIsBlocked == true,
oldValue: (previous?.threadViewModel?.threadIsBlocked == true),
accessibility: Accessibility(
identifier: "Block This User - Switch"
identifier: "Block - Switch"
)
),
accessibility: Accessibility(
@ -1120,7 +1120,7 @@ class ThreadSettingsViewModel: SessionTableViewModel, NavigatableStateHolder, Ob
placeholder: "nicknameEnter".localized(),
initialValue: current,
accessibility: Accessibility(
identifier: "Username"
identifier: "Username input"
)
),
onChange: { [weak self] updatedName in self?.updatedName = updatedName }

@ -453,7 +453,7 @@ class SettingsViewModel: SessionTableViewModel, NavigationItemSource, Navigatabl
placeholder: "displayNameEnter".localized(),
initialValue: current,
accessibility: Accessibility(
identifier: "Username"
identifier: "Username input"
)
),
onChange: { [weak self] updatedName in self?.updatedName = updatedName }

@ -341,7 +341,7 @@ class ThreadSettingsViewModelSpec: QuickSpec {
info: ConfirmationModal.Info.Body.InputInfo(
placeholder: "nicknameEnter".localized(),
initialValue: nil,
accessibility: Accessibility(identifier: "Username")
accessibility: Accessibility(identifier: "Username input")
),
onChange: { _ in }
)

Loading…
Cancel
Save