mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:44:05 +00:00
Fix for UI tests now showing the status bar. (#2065)
This commit is contained in:
@@ -42,7 +42,7 @@ class UserIndicatorController: ObservableObject, UserIndicatorControllerProtocol
|
|||||||
|
|
||||||
var window: UIWindow? {
|
var window: UIWindow? {
|
||||||
didSet {
|
didSet {
|
||||||
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self))
|
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self).statusBarHidden(ProcessInfo.isRunningUITests))
|
||||||
hostingController.view.backgroundColor = .clear
|
hostingController.view.backgroundColor = .clear
|
||||||
window?.rootViewController = hostingController
|
window?.rootViewController = hostingController
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
|
|||||||
|
|
||||||
windowManager.delegate = self
|
windowManager.delegate = self
|
||||||
|
|
||||||
ServiceLocator.shared.register(userIndicatorController: UserIndicatorControllerMock.default)
|
ServiceLocator.shared.register(userIndicatorController: UserIndicatorController())
|
||||||
|
|
||||||
AppSettings.configureWithSuiteName("io.element.elementx.uitests")
|
AppSettings.configureWithSuiteName("io.element.elementx.uitests")
|
||||||
AppSettings.reset()
|
AppSettings.reset()
|
||||||
@@ -63,8 +63,10 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func windowManagerDidConfigureWindows(_ windowManager: WindowManager) {
|
func windowManagerDidConfigureWindows(_ windowManager: WindowManager) {
|
||||||
guard let screenID = ProcessInfo.testScreenID, screenID == .appLockFlow || screenID == .appLockFlowDisabled else { return }
|
ServiceLocator.shared.userIndicatorController.window = windowManager.overlayWindow
|
||||||
|
|
||||||
|
// Set up the alternate window for the App Lock flow coordinator tests.
|
||||||
|
guard let screenID = ProcessInfo.testScreenID, screenID == .appLockFlow || screenID == .appLockFlowDisabled else { return }
|
||||||
let screen = MockScreen(id: screenID == .appLockFlow ? .appLockFlowAlternateWindow : .appLockFlowDisabledAlternateWindow, windowManager: windowManager)
|
let screen = MockScreen(id: screenID == .appLockFlow ? .appLockFlowAlternateWindow : .appLockFlowDisabledAlternateWindow, windowManager: windowManager)
|
||||||
windowManager.alternateWindow.rootViewController = UIHostingController(rootView: screen.coordinator.toPresentable().statusBarHidden())
|
windowManager.alternateWindow.rootViewController = UIHostingController(rootView: screen.coordinator.toPresentable().statusBarHidden())
|
||||||
alternateWindowMockScreen = screen
|
alternateWindowMockScreen = screen
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
Fix for the status bar being visible during UI tests.
|
||||||
Reference in New Issue
Block a user