From 54d5356e48dbc3e79c779653098f8436d0fafd28 Mon Sep 17 00:00:00 2001 From: Rasmus Tauts Date: Thu, 21 Sep 2023 11:22:28 +0300 Subject: [PATCH] fixup! Convert ConfirmationView form UIKit to SwiftUI Make orientation manager a part of 'SecureConversations.ConfirmationViewSwiftUI.Model'. --- .../RootCoordinator.Environment.Failing.swift | 3 ++- GliaWidgetsTests/Glia.Environment.Failing.swift | 3 ++- ...onversations.ConfirmationViewModelTests.swift | 16 ++++------------ ...sConfirmationScreenDynamicTypeFontTests.swift | 4 +--- ...versationsConfirmationScreenLayoutTests.swift | 4 +--- ...ureConversationsConfirmationScreenTests.swift | 4 +--- 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/GliaWidgetsTests/Coordinator/RootCoordinator.Environment.Failing.swift b/GliaWidgetsTests/Coordinator/RootCoordinator.Environment.Failing.swift index b339631f5..366c4165a 100644 --- a/GliaWidgetsTests/Coordinator/RootCoordinator.Environment.Failing.swift +++ b/GliaWidgetsTests/Coordinator/RootCoordinator.Environment.Failing.swift @@ -85,6 +85,7 @@ extension EngagementCoordinator.Environment { createSendMessagePayload: { _, _ in fail("\(Self.self).createSendMessagePayload") return .mock() - } + }, + orientationManager: .mock() ) } diff --git a/GliaWidgetsTests/Glia.Environment.Failing.swift b/GliaWidgetsTests/Glia.Environment.Failing.swift index fe3856b3d..14ba7bcff 100644 --- a/GliaWidgetsTests/Glia.Environment.Failing.swift +++ b/GliaWidgetsTests/Glia.Environment.Failing.swift @@ -54,7 +54,8 @@ extension Glia.Environment { return .mock() }, screenShareHandler: .mock, - messagesWithUnreadCountLoaderScheduler: CoreSdkClient.reactiveSwiftDateSchedulerMock + messagesWithUnreadCountLoaderScheduler: CoreSdkClient.reactiveSwiftDateSchedulerMock, + orientationManager: .mock() ) } diff --git a/GliaWidgetsTests/SecureConversations/Confirmation/SecureConversations.ConfirmationViewModelTests.swift b/GliaWidgetsTests/SecureConversations/Confirmation/SecureConversations.ConfirmationViewModelTests.swift index 6287e95c6..a1d6cc5d5 100644 --- a/GliaWidgetsTests/SecureConversations/Confirmation/SecureConversations.ConfirmationViewModelTests.swift +++ b/GliaWidgetsTests/SecureConversations/Confirmation/SecureConversations.ConfirmationViewModelTests.swift @@ -7,9 +7,7 @@ final class SecureConversationsConfirmationViewModelTests: XCTestCase { var viewModel: ConfirmationViewModel = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: Theme().defaultSecureConversationsConfirmationStyle, delegate: nil @@ -28,9 +26,7 @@ extension SecureConversationsConfirmationViewModelTests { let title = "Test" viewModel = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: .mock(title: title), delegate: nil @@ -62,9 +58,7 @@ extension SecureConversationsConfirmationViewModelTests { viewModel = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: .mock(), delegate: { event in @@ -85,9 +79,7 @@ extension SecureConversationsConfirmationViewModelTests { viewModel = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: .mock(), delegate: { event in diff --git a/SnapshotTests/SecureConversationsConfirmationScreenDynamicTypeFontTests.swift b/SnapshotTests/SecureConversationsConfirmationScreenDynamicTypeFontTests.swift index bedb08d29..d96dea1be 100644 --- a/SnapshotTests/SecureConversationsConfirmationScreenDynamicTypeFontTests.swift +++ b/SnapshotTests/SecureConversationsConfirmationScreenDynamicTypeFontTests.swift @@ -9,9 +9,7 @@ final class SecureConversationsConfirmationScreenDynamicTypeFontTests: SnapshotT func test_confirmationView_extra3Large() { let model: SecureConversations.ConfirmationViewSwiftUI.Model = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: theme.defaultSecureConversationsConfirmationStyle, delegate: nil diff --git a/SnapshotTests/SecureConversationsConfirmationScreenLayoutTests.swift b/SnapshotTests/SecureConversationsConfirmationScreenLayoutTests.swift index 692893405..5c42e4233 100644 --- a/SnapshotTests/SecureConversationsConfirmationScreenLayoutTests.swift +++ b/SnapshotTests/SecureConversationsConfirmationScreenLayoutTests.swift @@ -8,9 +8,7 @@ class SecureConversationsConfirmationScreenLayoutTests: SnapshotTestCase { func test_confirmationView() { let model: SecureConversations.ConfirmationViewSwiftUI.Model = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: theme.defaultSecureConversationsConfirmationStyle, delegate: nil diff --git a/SnapshotTests/SecureConversationsConfirmationScreenTests.swift b/SnapshotTests/SecureConversationsConfirmationScreenTests.swift index b79f29c3b..812d6eab9 100644 --- a/SnapshotTests/SecureConversationsConfirmationScreenTests.swift +++ b/SnapshotTests/SecureConversationsConfirmationScreenTests.swift @@ -9,9 +9,7 @@ class SecureConversationsConfirmationScreenTests: SnapshotTestCase { func test_confirmationView() { let model: SecureConversations.ConfirmationViewSwiftUI.Model = .init( environment: .init( - uiApplication: .mock, - uiDevice: .mock, - notificationCenter: .mock + orientationManager: .mock(), uiApplication: .mock ), style: theme.defaultSecureConversationsConfirmationStyle, delegate: nil