mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fix A11y tests (#5104)
* replace NavigationStack with ElementNavigationStack to allow the content to be rendered without a NavigationStack in a11y tests * fix a11y tests * update xcodeproject * swiftformat fix * use iOS 26.1 for CI * use a wrapper to solve the issue for a11y tests * ElementNavigationStack only uses the trick in DEBUG mode, and added a swiftlint rule to prevent the usage of NavigationStack
This commit is contained in:
@@ -394,61 +394,61 @@ struct CreateRoom_Previews: PreviewProvider, TestablePreview {
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: viewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Room")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: avatarViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Room with avatar")
|
||||
.snapshotPreferences(expect: avatarViewModel.context.$viewState.map { $0.avatarImage != nil })
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: spaceViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Space")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: spaceWithAvatarViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Space with avatar")
|
||||
.snapshotPreferences(expect: spaceWithAvatarViewModel.context.$viewState.map { $0.avatarImage != nil })
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: publicRoomViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Public Room")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: askToJoinViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Knockable Room")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: publicRoomInvalidAliasViewModel.context)
|
||||
}
|
||||
.snapshotPreferences(expect: publicRoomInvalidAliasViewModel.context.$viewState.map { !$0.aliasErrors.isEmpty })
|
||||
.previewDisplayName("Create Public Room, invalid alias")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: publicRoomExistingAliasViewModel.context)
|
||||
}
|
||||
.snapshotPreferences(expect: publicRoomExistingAliasViewModel.context.$viewState.map { !$0.aliasErrors.isEmpty })
|
||||
.previewDisplayName("Create Public Room, existing alias")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: selectedSpaceViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Room with already selected Space")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: selectedSpaceWithListViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Room with a selected Space from the list")
|
||||
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: selectedSpaceWithAskToJoinViewModel.context)
|
||||
}
|
||||
.previewDisplayName("Create Knockable Room with already selected Space")
|
||||
|
||||
@@ -21,7 +21,7 @@ struct CreateRoomSpaceSelectionSheet: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ElementNavigationStack {
|
||||
List {
|
||||
Section {
|
||||
ListRow(label: .plain(title: L10n.screenCreateRoomSpaceSelectionNoSpaceOption),
|
||||
|
||||
Reference in New Issue
Block a user