Use the window scene initialiser for UIWindow in tests

UIWindow.init() is deprecated in iOS 26. AuthenticationStartScreenViewModelTests
now creates its fake window from the test host's connected scene, matching
ServerSelectionScreenViewModelTests.
This commit is contained in:
Mauro Romito
2026-09-30 15:18:30 +02:00
committed by Mauro
parent 26c417ae68
commit 61384f9986
@@ -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",