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

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

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

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

Loading…
Cancel
Save