diff --git a/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift b/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift index 7d1a41909..ebbf9cfa0 100644 --- a/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift +++ b/UnitTests/Sources/AuthenticationStartScreenViewModelTests.swift @@ -315,7 +315,11 @@ final class AuthenticationStartScreenViewModelTests { userIndicatorController: UserIndicatorControllerMock()) // Add a fake window in order for the OAuth flow to continue - viewModel.context.send(viewAction: .updateWindow(UIWindow())) + guard let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene else { + Issue.record("The test host is missing a window scene.") + return + } + viewModel.context.send(viewAction: .updateWindow(UIWindow(windowScene: scene))) } private func makeClassicAppAccount(serverName: String = "company.com",