Skip to content

Commit 6067ae1

Browse files
authored
Merge pull request #8026 from woocommerce/td/7879-StoreCreationCoordinator-tests
Store creation M1: unit tests for coordinators
2 parents 72c3f71 + 378f5d9 commit 6067ae1

File tree

13 files changed

+227
-10
lines changed

13 files changed

+227
-10
lines changed

WooCommerce/Classes/Authentication/Epilogue/StorePickerCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Yosemite
77
///
88
final class StorePickerCoordinator: Coordinator {
99

10-
unowned var navigationController: UINavigationController
10+
unowned private(set) var navigationController: UINavigationController
1111

1212
/// Determines how the store picker should initialized
1313
///

WooCommerce/Classes/Authentication/Store Creation/LoggedOutStoreCreationCoordinator.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ final class LoggedOutStoreCreationCoordinator: Coordinator {
1010
case loginEmailError
1111
}
1212

13-
/// Mutable to conform to `Coordinator` protocol.
14-
var navigationController: UINavigationController
13+
let navigationController: UINavigationController
1514

1615
private var storePickerCoordinator: StorePickerCoordinator?
1716

WooCommerce/Classes/Authentication/Store Creation/StoreCreationCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ final class StoreCreationCoordinator: Coordinator {
1313
case storePicker
1414
}
1515

16-
var navigationController: UINavigationController
16+
let navigationController: UINavigationController
1717

1818
@Published private var possibleSiteURLsFromStoreCreation: Set<String> = []
1919
private var possibleSiteURLsFromStoreCreationSubscription: AnyCancellable?

WooCommerce/Classes/Tools/Coordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import UIKit
55
/// See: http://khanlou.com/2015/01/the-coordinator/
66
///
77
protocol Coordinator {
8-
var navigationController: UINavigationController { get set }
8+
var navigationController: UINavigationController { get }
99

1010
func start()
1111
}

WooCommerce/Classes/ViewRelated/Hub Menu/HubMenuCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import protocol Yosemite.StoresManager
1010
/// Coordinator for the HubMenu tab.
1111
///
1212
final class HubMenuCoordinator: Coordinator {
13-
var navigationController: UINavigationController
13+
let navigationController: UINavigationController
1414
var hubMenuController: HubMenuViewController?
1515

1616
private let pushNotificationsManager: PushNotesManager

WooCommerce/Classes/ViewRelated/Orders/Order Creation/FlowCoordinator/AddOrderCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import WordPressUI
77
/// Manages the different navigation flows that start from the Orders main tab
88
///
99
final class AddOrderCoordinator: Coordinator {
10-
var navigationController: UINavigationController
10+
let navigationController: UINavigationController
1111

1212
private let siteID: Int64
1313
private let sourceBarButtonItem: UIBarButtonItem?

WooCommerce/Classes/ViewRelated/Products/Add Product/AddProductCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import enum Experiments.ABTest
1212
/// coordinator.start()
1313
///
1414
final class AddProductCoordinator: Coordinator {
15-
var navigationController: UINavigationController
15+
let navigationController: UINavigationController
1616

1717
private let siteID: Int64
1818
private let sourceBarButtonItem: UIBarButtonItem?

WooCommerce/Classes/ViewRelated/Products/SKU Scanner/ProductSKUBarcodeScannerCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import UIKit
33

44
/// Coordinates navigation for product SKU barcode scanner based on camera permission.
55
final class ProductSKUBarcodeScannerCoordinator: Coordinator {
6-
var navigationController: UINavigationController
6+
let navigationController: UINavigationController
77
private let permissionChecker: CaptureDevicePermissionChecker
88
private let onSKUBarcodeScanned: (_ barcode: String) -> Void
99

WooCommerce/Classes/ViewRelated/Reviews/ReviewsCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import protocol Yosemite.StoresManager
1010
/// Coordinator for the Reviews tab.
1111
///
1212
final class ReviewsCoordinator: Coordinator {
13-
var navigationController: UINavigationController
13+
let navigationController: UINavigationController
1414

1515
private let pushNotificationsManager: PushNotesManager
1616
private let storesManager: StoresManager

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
020BE77523B4A7EC007FE54C /* AztecSourceCodeFormatBarCommandTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020BE77423B4A7EC007FE54C /* AztecSourceCodeFormatBarCommandTests.swift */; };
4747
020BE77723B4A9D9007FE54C /* AztecLinkFormatBarCommandTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020BE77623B4A9D9007FE54C /* AztecLinkFormatBarCommandTests.swift */; };
4848
020C908424C84652001E2BEB /* ProductListMultiSelectorSearchUICommandTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020C908324C84652001E2BEB /* ProductListMultiSelectorSearchUICommandTests.swift */; };
49+
020D0BFD2914E92800BB3DCE /* StorePickerCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020D0BFC2914E92800BB3DCE /* StorePickerCoordinatorTests.swift */; };
50+
020D0BFF2914F6BA00BB3DCE /* LoggedOutStoreCreationCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020D0BFE2914F6BA00BB3DCE /* LoggedOutStoreCreationCoordinatorTests.swift */; };
4951
020DD48A23229495005822B1 /* ProductsTabProductTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020DD48923229495005822B1 /* ProductsTabProductTableViewCell.swift */; };
5052
020DD48D2322A617005822B1 /* ProductsTabProductViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020DD48C2322A617005822B1 /* ProductsTabProductViewModel.swift */; };
5153
020DD48F232392C9005822B1 /* UIViewController+AppReview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 020DD48E232392C9005822B1 /* UIViewController+AppReview.swift */; };
@@ -229,6 +231,7 @@
229231
0269576A23726304001BA0BF /* KeyboardFrameObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269576923726304001BA0BF /* KeyboardFrameObserver.swift */; };
230232
0269576D23726401001BA0BF /* KeyboardFrameObserverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269576C23726401001BA0BF /* KeyboardFrameObserverTests.swift */; };
231233
02695770237281A9001BA0BF /* AztecTextViewAttachmentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269576F237281A9001BA0BF /* AztecTextViewAttachmentHandler.swift */; };
234+
0269A5E72913FD22003B20EB /* StoreCreationCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269A5E62913FD22003B20EB /* StoreCreationCoordinatorTests.swift */; };
232235
0269A63C2581D26C007B49ED /* ShippingLabelPrintingStepListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0269A63B2581D26C007B49ED /* ShippingLabelPrintingStepListView.swift */; };
233236
026B3C57249A046E00F7823C /* TextFieldTextAlignment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 026B3C56249A046E00F7823C /* TextFieldTextAlignment.swift */; };
234237
026B80CF289A5E0B001960E4 /* LoginOnboardingSurveyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 026B80CE289A5E0B001960E4 /* LoginOnboardingSurveyView.swift */; };
@@ -1998,6 +2001,8 @@
19982001
020BE77423B4A7EC007FE54C /* AztecSourceCodeFormatBarCommandTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AztecSourceCodeFormatBarCommandTests.swift; sourceTree = "<group>"; };
19992002
020BE77623B4A9D9007FE54C /* AztecLinkFormatBarCommandTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AztecLinkFormatBarCommandTests.swift; sourceTree = "<group>"; };
20002003
020C908324C84652001E2BEB /* ProductListMultiSelectorSearchUICommandTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductListMultiSelectorSearchUICommandTests.swift; sourceTree = "<group>"; };
2004+
020D0BFC2914E92800BB3DCE /* StorePickerCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StorePickerCoordinatorTests.swift; sourceTree = "<group>"; };
2005+
020D0BFE2914F6BA00BB3DCE /* LoggedOutStoreCreationCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggedOutStoreCreationCoordinatorTests.swift; sourceTree = "<group>"; };
20012006
020DD48923229495005822B1 /* ProductsTabProductTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductsTabProductTableViewCell.swift; sourceTree = "<group>"; };
20022007
020DD48C2322A617005822B1 /* ProductsTabProductViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductsTabProductViewModel.swift; sourceTree = "<group>"; };
20032008
020DD48E232392C9005822B1 /* UIViewController+AppReview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+AppReview.swift"; sourceTree = "<group>"; };
@@ -2181,6 +2186,7 @@
21812186
0269576923726304001BA0BF /* KeyboardFrameObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardFrameObserver.swift; sourceTree = "<group>"; };
21822187
0269576C23726401001BA0BF /* KeyboardFrameObserverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardFrameObserverTests.swift; sourceTree = "<group>"; };
21832188
0269576F237281A9001BA0BF /* AztecTextViewAttachmentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AztecTextViewAttachmentHandler.swift; sourceTree = "<group>"; };
2189+
0269A5E62913FD22003B20EB /* StoreCreationCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreCreationCoordinatorTests.swift; sourceTree = "<group>"; };
21842190
0269A63B2581D26C007B49ED /* ShippingLabelPrintingStepListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShippingLabelPrintingStepListView.swift; sourceTree = "<group>"; };
21852191
026B3C56249A046E00F7823C /* TextFieldTextAlignment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldTextAlignment.swift; sourceTree = "<group>"; };
21862192
026B80CE289A5E0B001960E4 /* LoginOnboardingSurveyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginOnboardingSurveyView.swift; sourceTree = "<group>"; };
@@ -6153,6 +6159,9 @@
61536159
DE61979428A25842005E4362 /* StorePickerViewModelTests.swift */,
61546160
DE3404E928B4C1D000CF0D97 /* NonAtomicSiteViewModelTests.swift */,
61556161
DE50295228BF4A8A00551736 /* JetpackConnectionWebViewModelTests.swift */,
6162+
0269A5E62913FD22003B20EB /* StoreCreationCoordinatorTests.swift */,
6163+
020D0BFC2914E92800BB3DCE /* StorePickerCoordinatorTests.swift */,
6164+
020D0BFE2914F6BA00BB3DCE /* LoggedOutStoreCreationCoordinatorTests.swift */,
61566165
);
61576166
path = Authentication;
61586167
sourceTree = "<group>";
@@ -10737,6 +10746,7 @@
1073710746
CC53FB402759042600C4CA4F /* ProductSelectorViewModelTests.swift in Sources */,
1073810747
DE0A2EB1281BED38007A8015 /* ProductCategorySelectorViewModelTests.swift in Sources */,
1073910748
03AA16602719B83D005CCB7B /* ReceiptActionCoordinatorTests.swift in Sources */,
10749+
020D0BFD2914E92800BB3DCE /* StorePickerCoordinatorTests.swift in Sources */,
1074010750
CEEC9B6621E7C5200055EEF0 /* AppRatingManagerTests.swift in Sources */,
1074110751
263EB409242C58EA00F3A15F /* ProductFormActionsFactoryTests.swift in Sources */,
1074210752
02BA23C022EE9DAF009539E7 /* AsyncDictionaryTests.swift in Sources */,
@@ -10760,6 +10770,7 @@
1076010770
DEC51AA0274F9922009F3DF4 /* JetpackInstallStepsViewModelTests.swift in Sources */,
1076110771
E1068058285C787100668B46 /* BetaFeaturesTests.swift in Sources */,
1076210772
26C6E8E426E2D87C00C7BB0F /* CountrySelectorViewModelTests.swift in Sources */,
10773+
0269A5E72913FD22003B20EB /* StoreCreationCoordinatorTests.swift in Sources */,
1076310774
02CE4307276994920006EAEF /* ProductSKUBarcodeScannerCoordinatorTests.swift in Sources */,
1076410775
0999877427D2819F00F82C65 /* BulkUpdateViewControllerTests.swift in Sources */,
1076510776
3190D61D26D6E97B00EF364D /* CardPresentModalRetryableErrorTests.swift in Sources */,
@@ -11077,6 +11088,7 @@
1107711088
579CDF01274D811D00E8903D /* StoreStatsUsageTracksEventEmitterTests.swift in Sources */,
1107811089
262A2C2B2537A3330086C1BE /* MockRefunds.swift in Sources */,
1107911090
027F240C258371150021DB06 /* RefundShippingLabelViewModelTests.swift in Sources */,
11091+
020D0BFF2914F6BA00BB3DCE /* LoggedOutStoreCreationCoordinatorTests.swift in Sources */,
1108011092
D85136DD231E613900DD0539 /* ReviewsViewModelTests.swift in Sources */,
1108111093
DEFD6E61264990FB00E51E0D /* SitePluginListViewModelTests.swift in Sources */,
1108211094
02B2C831249C4C8D0040C83C /* TextFieldTextAlignmentTests.swift in Sources */,

0 commit comments

Comments
 (0)