mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user