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
@@ -253,9 +253,14 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview {
static var previews: some View {
NotificationSettingsScreen(context: viewModel.context)
.snapshotPreferences(delay: 2.0)
.snapshotPreferences(expect: viewModel.context.$viewState.map { state in
state.settings != nil
})
NotificationSettingsScreen(context: viewModelConfigurationMismatch.context)
.snapshotPreferences(delay: 2.0)
.snapshotPreferences(expect: viewModelConfigurationMismatch.context.$viewState.map { state in
state.settings != nil
})
.previewDisplayName("Configuration mismatch")
}
}
@@ -239,7 +239,9 @@ struct SettingsScreen_Previews: PreviewProvider, TestablePreview {
static var previews: some View {
NavigationStack {
SettingsScreen(context: viewModel.context)
.snapshotPreferences(delay: 1.0)
.snapshotPreferences(expect: viewModel.context.$viewState.map { state in
state.accountSessionsListURL != nil
})
}
}
}