mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Use iOS 26 Observation for Unit and Preview tests. (#5797)
* use observation in unit and preview tests instead of the async stream * use a parsing approach that is independent of the sourcery annotation * Fix observation deferred fulfillments not receiving the initial value Observation's observe only emits transitions, not the value present at subscription time. Drop the leading initial value from the affected transitionValues sequences and assert it directly with #expect instead. * improved docs
This commit is contained in:
+1
@@ -110,6 +110,7 @@ struct SecureBackupLogoutConfirmationScreen: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 26.0, *)
|
||||
struct SecureBackupLogoutConfirmationScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = makeViewModel(mode: .saveRecoveryKey)
|
||||
static let waitingViewModel = makeViewModel(mode: .waitingToStart(hasStalled: false))
|
||||
|
||||
+1
@@ -237,6 +237,7 @@ private struct RecoveryKeyView: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 26.0, *)
|
||||
struct SecureBackupRecoveryKeyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let key = "EsTM njec uHYA yHmh dQdW Nj4o bNRU 9jMN XGMc KUNM UFr5 R8GY"
|
||||
static let notSetUpViewModel = viewModel(recoveryState: .disabled)
|
||||
|
||||
@@ -116,6 +116,7 @@ struct SecureBackupScreen: View {
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
@available(iOS 26.0, *)
|
||||
struct SecureBackupScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let bothSetupViewModel = viewModel(keyBackupState: .enabled, recoveryState: .enabled)
|
||||
static let onlyKeyBackupSetUpViewModel = viewModel(keyBackupState: .enabled, recoveryState: .disabled)
|
||||
|
||||
Reference in New Issue
Block a user