File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
WooCommerce/WooCommerceTests/Authentication Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -42,4 +42,38 @@ final class StorePickerCoordinatorTests: XCTestCase {
4242 let storeCreationNavigationController = try XCTUnwrap ( navigationController. presentedViewController as? UINavigationController )
4343 assertThat ( storeCreationNavigationController. topViewController, isAnInstanceOf: AuthenticatedWebViewController . self)
4444 }
45+
46+ func test_standard_configuration_presents_storePicker( ) throws {
47+ // Given
48+ let coordinator = StorePickerCoordinator ( navigationController, config: . standard)
49+
50+ // When
51+ coordinator. start ( )
52+
53+ // Then
54+ waitUntil {
55+ self . navigationController. presentedViewController is WooNavigationController
56+ }
57+ XCTAssertNil ( navigationController. topViewController)
58+
59+ let storePickerNavigationController = try XCTUnwrap ( navigationController. presentedViewController as? UINavigationController )
60+ assertThat ( storePickerNavigationController. topViewController, isAnInstanceOf: StorePickerViewController . self)
61+ }
62+
63+ func test_switchingStores_configuration_presents_storePicker( ) throws {
64+ // Given
65+ let coordinator = StorePickerCoordinator ( navigationController, config: . switchingStores)
66+
67+ // When
68+ coordinator. start ( )
69+
70+ // Then
71+ waitUntil {
72+ self . navigationController. presentedViewController is WooNavigationController
73+ }
74+ XCTAssertNil ( navigationController. topViewController)
75+
76+ let storePickerNavigationController = try XCTUnwrap ( navigationController. presentedViewController as? UINavigationController )
77+ assertThat ( storePickerNavigationController. topViewController, isAnInstanceOf: StorePickerViewController . self)
78+ }
4579}
You can’t perform that action at this time.
0 commit comments