mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fix for UI tests now showing the status bar. (#2065)
This commit is contained in:
parent
b5cc2cbf61
commit
a2c2f872cd
@ -42,7 +42,7 @@ class UserIndicatorController: ObservableObject, UserIndicatorControllerProtocol
|
||||
|
||||
var window: UIWindow? {
|
||||
didSet {
|
||||
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self))
|
||||
let hostingController = UIHostingController(rootView: UserIndicatorPresenter(userIndicatorController: self).statusBarHidden(ProcessInfo.isRunningUITests))
|
||||
hostingController.view.backgroundColor = .clear
|
||||
window?.rootViewController = hostingController
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
|
||||
|
||||
windowManager.delegate = self
|
||||
|
||||
ServiceLocator.shared.register(userIndicatorController: UserIndicatorControllerMock.default)
|
||||
ServiceLocator.shared.register(userIndicatorController: UserIndicatorController())
|
||||
|
||||
AppSettings.configureWithSuiteName("io.element.elementx.uitests")
|
||||
AppSettings.reset()
|
||||
@ -63,8 +63,10 @@ class UITestsAppCoordinator: AppCoordinatorProtocol, WindowManagerDelegate {
|
||||
}
|
||||
|
||||
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)
|
||||
windowManager.alternateWindow.rootViewController = UIHostingController(rootView: screen.coordinator.toPresentable().statusBarHidden())
|
||||
alternateWindowMockScreen = screen
|
||||
|
1
changelog.d/pr-2065.bugfix
Normal file
1
changelog.d/pr-2065.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix for the status bar being visible during UI tests.
|
Loading…
x
Reference in New Issue
Block a user