Retrofit deferFulfillment onto snapshot tests. (#3641)

* Retrofit `deferFulfillment` onto snapshot tests.

* Convert a bunch of preview tests to the new fulfillment publisher

* Convert more tests

* Remove unneeded delays from the remaining tests

* Remove snapshotting delay option.
This commit is contained in:
Stefan Ceriu
2024-12-20 15:30:59 +02:00
committed by GitHub
parent 365797c8b7
commit 536f01abbd
49 changed files with 606 additions and 532 deletions
@@ -196,19 +196,26 @@ struct HomeScreen_Previews: PreviewProvider, TestablePreview {
NavigationStack {
HomeScreen(context: loadingViewModel.context)
}
.snapshotPreferences(expect: loadedViewModel.context.$viewState.map { state in
state.roomListMode == .skeletons
})
.previewDisplayName("Loading")
NavigationStack {
HomeScreen(context: emptyViewModel.context)
}
.snapshotPreferences(expect: emptyViewModel.context.$viewState.map { state in
state.roomListMode == .empty
})
.previewDisplayName("Empty")
.snapshotPreferences(delay: 4.0)
NavigationStack {
HomeScreen(context: loadedViewModel.context)
}
.snapshotPreferences(expect: loadedViewModel.context.$viewState.map { state in
state.roomListMode == .rooms
})
.previewDisplayName("Loaded")
.snapshotPreferences(delay: 4.0)
}
static func viewModel(_ mode: HomeScreenRoomListMode) -> HomeScreenViewModel {