Update UI test snapshots. (#4722)

* Update UI test snapshots.

* Stop snapshotting the photo picker, just assert that it was presented.

* Fix a swipe action not being detected in the UI tests.

* Handle the split view properly on iPad when accepting a space invite.

Fixes a test but also properly handles replacing a room with a space.
This commit is contained in:
Doug
2025-11-11 11:34:01 +00:00
committed by GitHub
parent 66f3b86c69
commit 5cfe538f92
38 changed files with 90 additions and 88 deletions

View File

@@ -47,7 +47,6 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
private var cancellables = Set<AnyCancellable>()
private let sidebarNavigationStackCoordinator: NavigationStackCoordinator
private let detailNavigationStackCoordinator: NavigationStackCoordinator
private let selectedRoomSubject = CurrentValueSubject<String?, Never>(nil)
@@ -64,7 +63,6 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
self.flowParameters = flowParameters
sidebarNavigationStackCoordinator = NavigationStackCoordinator(navigationSplitCoordinator: navigationSplitCoordinator)
detailNavigationStackCoordinator = NavigationStackCoordinator(navigationSplitCoordinator: navigationSplitCoordinator)
navigationSplitCoordinator.setSidebarCoordinator(sidebarNavigationStackCoordinator)
setupStateMachine()
@@ -272,6 +270,9 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
switch context.toState {
case .roomList(detailState: .room(let detailStateRoomID)):
self?.selectedRoomSubject.send(detailStateRoomID)
case .roomList(detailState: .space):
// We don't show joined spaces in the room list yet so clear the selected room when accepting a space invite.
self?.selectedRoomSubject.send(nil)
case .roomList(detailState: nil):
self?.selectedRoomSubject.send(nil)
default:
@@ -472,9 +473,10 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
via: [String],
entryPoint: RoomFlowCoordinatorEntryPoint,
animated: Bool) {
let navigationStackCoordinator = NavigationStackCoordinator(navigationSplitCoordinator: navigationSplitCoordinator)
let coordinator = RoomFlowCoordinator(roomID: roomID,
isChildFlow: false,
navigationStackCoordinator: detailNavigationStackCoordinator,
navigationStackCoordinator: navigationStackCoordinator,
flowParameters: flowParameters)
coordinator.actions.sink { [weak self] action in
@@ -495,9 +497,7 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
roomFlowCoordinator = coordinator
if navigationSplitCoordinator.detailCoordinator !== detailNavigationStackCoordinator {
navigationSplitCoordinator.setDetailCoordinator(detailNavigationStackCoordinator, animated: animated)
}
navigationSplitCoordinator.setDetailCoordinator(navigationStackCoordinator, animated: animated)
switch entryPoint {
case .room:
@@ -530,10 +530,11 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
// MARK: Space Flow
private func startSpaceFlow(spaceRoomListProxy: SpaceRoomListProxyProtocol, animated: Bool) {
let navigationStackCoordinator = NavigationStackCoordinator(navigationSplitCoordinator: navigationSplitCoordinator)
let coordinator = SpaceFlowCoordinator(entryPoint: .space(spaceRoomListProxy),
spaceServiceProxy: userSession.clientProxy.spaceService,
isChildFlow: false,
navigationStackCoordinator: detailNavigationStackCoordinator,
navigationStackCoordinator: navigationStackCoordinator,
flowParameters: flowParameters)
coordinator.actionsPublisher
.sink { [weak self] action in
@@ -551,9 +552,7 @@ class ChatsFlowCoordinator: FlowCoordinatorProtocol {
spaceFlowCoordinator = coordinator
if navigationSplitCoordinator.detailCoordinator !== detailNavigationStackCoordinator {
navigationSplitCoordinator.setDetailCoordinator(detailNavigationStackCoordinator, animated: animated)
}
navigationSplitCoordinator.setDetailCoordinator(navigationStackCoordinator, animated: animated)
coordinator.start()
}

View File

@@ -154,8 +154,9 @@ class ChatsFlowCoordinatorStateMachine {
switch (fromState, event) {
case (.roomList, .selectRoom(let roomID, _, _)):
return .roomList(detailState: .room(roomID: roomID))
case (.roomList, .deselectRoom):
return .roomList(detailState: nil)
case (.roomList(let detailState), .deselectRoom):
// Ignore the flow's dismissal if it has already been replaced with a space.
return detailState == .space ? nil : .roomList(detailState: nil)
case (.roomList, .startSpaceFlow):
return .roomList(detailState: .space)

View File

@@ -40,8 +40,10 @@ class StartChatTests: XCTestCase {
app.buttons[A11yIdentifiers.createRoomScreen.roomAvatar].tap()
app.popovers.buttons.element(boundBy: 2).tap() // There are 2 buttons with the accessibility identifier, so use the index to get the right one.
let cancelButton = app.buttons["Cancel"]
XCTAssertTrue(cancelButton.waitForExistence(timeout: 1.0))
try await app.assertScreenshot(step: Step.createRoomAvatarPicker)
// The system UI snapshot is unreliable, instead lets just assert something.
// XCTAssertTrue(cancelButton.waitForExistence(timeout: 1.0))
// try await app.assertScreenshot(step: Step.createRoomAvatarPicker)
XCTAssertTrue(app.navigationBars["Photos"].waitForExistence(timeout: 20.0)) // The first load of the photo picker can sometimes be *really* slow.
cancelButton.tap()
// typeText sometimes misses letters but it's faster than typing one letter at a time

View File

@@ -52,7 +52,7 @@ class UserSessionScreenTests: XCTestCase {
try await Task.sleep(for: .seconds(1))
let cell = app.cells.element(boundBy: 1) // Skip the typing indicator cell
cell.swipeRight(velocity: .fast)
cell.swipeRight(velocity: .slow) // The iOS 26 simulator doesn't like a fast swipe.
try await app.assertScreenshot()
}
@@ -130,9 +130,15 @@ class UserSessionScreenTests: XCTestCase {
try await Task.sleep(for: .seconds(1))
try await app.assertScreenshot(step: Step.spaceScreen)
// Go back to the room list.
app.navigationBars.buttons["Chats"].firstMatch.tap(.center)
XCTAssert(app.staticTexts["Chats"].waitForExistence(timeout: 5.0))
if UIDevice.current.userInterfaceIdiom == .phone {
// Go back to the room list on iPhone.
app.navigationBars.buttons["Chats"].firstMatch.tap(.center)
XCTAssert(app.staticTexts["Chats"].waitForExistence(timeout: 5.0))
} else {
// Select a different room on iPad (otherwise nothing changes when the join button is tapped below).
app.buttons[A11yIdentifiers.homeScreen.roomName(firstRoomName)].tap()
XCTAssert(app.staticTexts[firstRoomName].waitForExistence(timeout: 5.0))
}
// Tap the join button in the space invite cell.
app.buttons.matching(NSPredicate(format: "identifier == %@ && label == %@",

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70ef319bb965ef5ee250ed1d93e1aee7ed04cc6684a1deb9a74d8e6a93c50cf5
size 106866
oid sha256:ac696fb26f2b47c959e0f88d4f21768ee87a0228ba2807d78600ce80cbc1c02a
size 106916

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef06ce7be8e7dae489a92c2cd05c36b17066d35b7a91b5d4d2024f40e3f61a71
size 204719
oid sha256:eac8e4656d81e4da09144b71bb38bedb7eb45f9263c40a608c3032d5013a7058
size 206598

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ed9b392fdbe72bd38cf0e44bc91289adc90c2c5e82f9ac3a3be9a6e5fb6f724d
size 95599
oid sha256:04783eca3e3d7a1809400459a9a37dd32bf9ce8762ed154e9061ffd4939ee50f
size 95250

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3a9b72c2809f2d23be3c1533ddf287b3cd5381e7ca6725cb96d9003490cc88f7
size 1336273
oid sha256:501ce2d47a3fef0852b6a350d03846f4f67e872be539f5f30413ac78fbad55fd
size 1335528

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4377e74591df3811f06e07d2869322a8c7720974a2fb53ede8a2ce84c6dd8c7f
size 1376042
oid sha256:1664640bc38ed657919178e5279e8a8ce2edde670a082ce3bffaea8e542375d6
size 1374894

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:61bbaa2092d9fea30113d58b24d32990855f489c1df7414adb6db95479291241
size 1337427
oid sha256:0e76bd2301abab5b21f6cff371360bdccd4bda638101c842c77480043a761f43
size 1337022

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e813e98841936663dbcc89cc2465af3d4d9e1cf3355f4d983adc6526e8b40fb
size 137248
oid sha256:ab10599096ae67fa6418221b3dc9caa99b68d38b3afecdc806866cd866218d3d
size 136758

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:db85b6cab5a2c6817c02d32635cdb41086649988d62443513d0a75cdc19d19aa
size 146200
oid sha256:a2f0e2a3e90759a17d1407e2436f8b396db9c18c7e70a0003fa46e952d811f27
size 145897

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:598c908578337ec3aaf75c60fed49f72c8f208a2652746e9773fa1cc2c56adca
size 124710
oid sha256:4b999fc0750bad90905ae09f9246b41fe33626f5184ff308da2071deb4382c1c
size 106184

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:46198f74a52e247012c2d0cd0804e0d08a8a4ce48a419505a9772d6fa399f58e
size 157072
oid sha256:77e3799aa6225b7ef47229f9420539c84bf1082da64b256e9d94466c3c2c4f70
size 119530

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b6f837e179e3ab8ac7e6a28cb7d1c7f943c5ff18fe06396f138d19f5916e99b9
size 282814
oid sha256:4bdb59a6668676605dc18daabf0889d23e8f78b1fd24f7345d48a6660a24a713
size 281536

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b855406462ee246e8a79a6b5504f88829f4ac3bd373144496c49753c35f1c75e
size 100523
oid sha256:d44c361761c59000fbf0af9b7e344a8a0e22f3cf8c6142f1c11f9534c225205c
size 100540

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68a9f323c7148ff25e31556602ed7dd5d683d0244aa3759aa2e9460ac6d856c1
size 121238
oid sha256:6208b8ba479f30d8cd3c0417231740ee261057af834cfd95c27fa2a11ebf7aa7
size 121189

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:420e28ae3043e3e731e88e3bcd2b502147fcc32a7f0e11130cd514e1c4649ac4
size 294960
oid sha256:ea76ac90db27be4d15b4554d27bef2b471e05ea00be5193ca763ceef4f20de21
size 294891

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5bb42c4a8d970a67a649d3e4ac3a35d98190b908a6571cdd84801dcb671e3dac
size 169281
oid sha256:272b213b9b88f9ab97bd2c3107ea701a555f452a569d4188a90d4826ca64c93a
size 167976

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:884e2b6d8fef3b0760449f505fe8bc77831073c77e7b7b95a254758f7cc2563b
size 299955
oid sha256:397ec4ce044b47186aade5c7221d2848652063b661f1ff6b2d2cfeaa4ec54f88
size 299476

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d36ca66fdd302ba4c9d4be1fc3c7454f413327df73fcafb599adfb1ca3cb5acc
size 304277
oid sha256:27c23caeaf66cf0d0ffd2a190fb9127f342b275c2d55bef86338af246adb59be
size 303183

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e8f9f46d72fdb0fc368971dc6f5cdd695ac3c513045522cc97d3d36cf1bfa734
size 210552
oid sha256:5d80b1f5b22cf322edeb3965ff5dc820956324ebc06b594ff6ec41e750bddd87
size 210138

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf8ba7b1d3b5f2b5bd13d177c171e08fbdc2653d8d4e78ccc7e1a82e5b289f73
size 133153
oid sha256:27abcc3a01a042e605be9d353760203ff7ff0252e0203157b925f0529a9e66b7
size 133157

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e01853cbe361943fadeb7308b70cea20258079b17cc135d0974d15433387fa9
size 121527
oid sha256:a9e0ecabedc9d0e26f9f2a99479f59e20fb39cd4eed5f7374fadeabf50d12da5
size 121533

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eca5ee382854997cf38983d25ae70925ddbada00b657321ba716b108c3a2a638
size 164679
oid sha256:135d9842e947758f90d5f0dcf1cc8a599ae79a66096220ccf27bb85f2e755d37
size 164716

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6254d3836e18d9d28c40d5595f93c46bd12588e6ed84187a133580e4ad1d4fd0
size 90013
oid sha256:bd16f58db996ab07ab451649482f75567ee02ccd02cb85fc6f5e7e066c09530c
size 89907

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f45cf3369a954ea5b96807bf2cbe6946c5b3e9cda892b6d7dc60b2ae965010b0
size 146093
oid sha256:5947dc3ac3159a0e1eef13048ae1819c8ca159391d1c947838dbe559387718f9
size 146103

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:02ca9f1df5aa0d22a05dcfb827df9d58351dea413d65cec8ad661132c24d2f62
size 90337
oid sha256:bd16f58db996ab07ab451649482f75567ee02ccd02cb85fc6f5e7e066c09530c
size 89907

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2272590d001892162b166af9e7a650014f5cac4ee10fdcd8d392acf727349cf0
size 146475
oid sha256:5947dc3ac3159a0e1eef13048ae1819c8ca159391d1c947838dbe559387718f9
size 146103

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:997efbd19dc47fb3e401fada208d982f64bf5128d340e00cff97dc6c084e910b
size 136946
oid sha256:27a410db01516a2299166c195316107b86210aaa0ca95b4d52a9a2cb2291f160
size 136499

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:02ca9f1df5aa0d22a05dcfb827df9d58351dea413d65cec8ad661132c24d2f62
size 90337
oid sha256:bd16f58db996ab07ab451649482f75567ee02ccd02cb85fc6f5e7e066c09530c
size 89907

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2272590d001892162b166af9e7a650014f5cac4ee10fdcd8d392acf727349cf0
size 146475
oid sha256:5947dc3ac3159a0e1eef13048ae1819c8ca159391d1c947838dbe559387718f9
size 146103

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d0f8aff85f5930db29bc103b67ae2ea3bd793e6da755b74b3ec4bc3294a24664
size 2332509

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c0f51cb1e35bb75ae45f2f909e45f809febe00c86f7b7d88e63e9cdfb322043b
size 2458946

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6ff6a8f2cb774d93ad7f6bb1e833d7642486056d8ef7512dc8fbfa4079b0c19
size 382423
oid sha256:183db1d4451e0b945d955969dbb006ff3444695befecbf00dee12e5d9cb2afcd
size 383420

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c3bba429e501d5fcb2d60e7d5b92ee1e4ba893a8132a740118f8d10e0afd7467
size 428299
oid sha256:5983a9aed9bb5a07cc852c4ef8c7f731122947ed93ce8576958268b47c9468ce
size 429487

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e49fdb6ddc0ad88eb66fc1786671bedb32e373a9e791dbee48631ee529bf87fd
size 489325
oid sha256:0fba754b3f45ccce87f5613b2114d77dbc6ada1a81f2fbf737176adfc5248d46
size 490590

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8d426857e9ed41c8425cbe8505f3e380b0b599693a938e4915aa15b53c1bf960
size 560022
oid sha256:ae0be3ed3783ec04da0632a4e0f98721966ae09f69efb22d7ec86c718ba64a8b
size 564285