diff --git a/Kickstarter-iOS/Features/PledgeView/Controllers/PledgeViewControllerTests.swift b/Kickstarter-iOS/Features/PledgeView/Controllers/PledgeViewControllerTests.swift index 5a4e0a6b38..293c91412d 100644 --- a/Kickstarter-iOS/Features/PledgeView/Controllers/PledgeViewControllerTests.swift +++ b/Kickstarter-iOS/Features/PledgeView/Controllers/PledgeViewControllerTests.swift @@ -40,6 +40,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -87,6 +88,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -121,6 +123,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -171,6 +174,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -220,6 +224,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -264,6 +269,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -308,6 +314,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -353,6 +360,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -401,6 +409,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -450,6 +459,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -493,6 +503,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -525,6 +536,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: .template, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -561,6 +573,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: .template, rewards: [reward, .noReward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1, Reward.noReward.id: 1], selectedLocationId: nil, refTag: nil, @@ -599,6 +612,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: .template, rewards: [reward, .noReward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1, Reward.noReward.id: 1], selectedLocationId: nil, refTag: nil, @@ -639,6 +653,7 @@ final class PledgeViewControllerTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1, addOnReward2], + selectedShippingRule: ShippingRule.template, selectedQuantities: [reward.id: 1, addOnReward1.id: 2, addOnReward2.id: 1], selectedLocationId: ShippingRule.template.id, refTag: .projectPage, diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewController.swift b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewController.swift index 0d65995f3b..94f43e48be 100644 --- a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewController.swift +++ b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewController.swift @@ -11,10 +11,6 @@ final class RewardAddOnSelectionViewController: UIViewController { private lazy var headerLabel: UILabel = UILabel(frame: .zero) private lazy var headerView: UIView = UIView(frame: .zero) private lazy var headerRootStackView: UIStackView = UIStackView(frame: .zero) - private lazy var pledgeShippingLocationViewController: PledgeShippingLocationViewController = { - PledgeShippingLocationViewController.instantiate() - |> \.delegate .~ self - }() private lazy var continueCTAView: RewardAddOnSelectionContinueCTAView = { RewardAddOnSelectionContinueCTAView(frame: .zero) @@ -96,11 +92,8 @@ final class RewardAddOnSelectionViewController: UIViewController { |> ksr_addSubviewToParent() |> ksr_constrainViewToEdgesInParent(priority: UILayoutPriority(rawValue: 999)) - _ = ([self.headerLabel, self.pledgeShippingLocationViewController.view], self.headerRootStackView) + _ = ([self.headerLabel], self.headerRootStackView) |> ksr_addArrangedSubviewsToStackView() - - self.addChild(self.pledgeShippingLocationViewController) - self.pledgeShippingLocationViewController.didMove(toParent: self) } private func setupConstraints() { @@ -146,21 +139,12 @@ final class RewardAddOnSelectionViewController: UIViewController { override func bindViewModel() { super.bindViewModel() - self.pledgeShippingLocationViewController.view.rac.hidden - = self.viewModel.outputs.shippingLocationViewIsHidden - self.viewModel.outputs.configureContinueCTAViewWithData .observeForUI() .observeValues { [weak self] data in self?.continueCTAView.configure(with: data) } - self.viewModel.outputs.configurePledgeShippingLocationViewControllerWithData - .observeForUI() - .observeValues { [weak self] data in - self?.pledgeShippingLocationViewController.configureWith(value: data) - } - self.viewModel.outputs.loadAddOnRewardsIntoDataSourceAndReloadTableView .observeForUI() .observeValues { [weak self] items in @@ -227,25 +211,6 @@ final class RewardAddOnSelectionViewController: UIViewController { } } -// MARK: - PledgeShippingLocationViewControllerDelegate - -extension RewardAddOnSelectionViewController: PledgeShippingLocationViewControllerDelegate { - func pledgeShippingLocationViewController( - _: PledgeShippingLocationViewController, - didSelect shippingRule: ShippingRule - ) { - self.viewModel.inputs.shippingRuleSelected(shippingRule) - } - - func pledgeShippingLocationViewControllerLayoutDidUpdate(_: PledgeShippingLocationViewController) { - self.tableView.ksr_sizeHeaderFooterViewsToFit() - } - - func pledgeShippingLocationViewControllerFailedToLoad(_: PledgeShippingLocationViewController) { - self.viewModel.inputs.shippingLocationViewDidFailToLoad() - } -} - // MARK: - RewardAddOnCardViewDelegate extension RewardAddOnSelectionViewController: RewardAddOnCardViewDelegate { diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewControllerTests.swift b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewControllerTests.swift index 43af1e6a09..bc50f55e15 100644 --- a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewControllerTests.swift +++ b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/RewardAddOnSelectionViewControllerTests.swift @@ -38,13 +38,14 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { let mockService = MockService(fetchRewardAddOnsSelectionViewRewardsResult: .success(project)) - combos(Language.allLanguages, Device.allCases).forEach { language, device in + orthogonalCombos(Language.allLanguages, Device.allCases).forEach { language, device in withEnvironment(apiService: mockService) { let controller = RewardAddOnSelectionViewController.instantiate() let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -97,12 +98,13 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { fetchRewardAddOnsSelectionViewRewardsResult: .success(project) ) - combos(Language.allLanguages, Device.allCases).forEach { language, device in + orthogonalCombos(Language.allLanguages, Device.allCases).forEach { language, device in withEnvironment(apiService: mockService) { let controller = RewardAddOnSelectionViewController.instantiate() let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -114,13 +116,6 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { self.scheduler.advance() - controller.pledgeShippingLocationViewController( - PledgeShippingLocationViewController.instantiate(), - didSelect: .template - ) - - self.scheduler.advance(by: .seconds(1)) - assertSnapshot( matching: parent.view, as: .image(perceptualPrecision: 0.98), @@ -201,12 +196,13 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { fetchRewardAddOnsSelectionViewRewardsResult: .success(project) ) - combos(Language.allLanguages, Device.allCases).forEach { language, device in + orthogonalCombos(Language.allLanguages, Device.allCases).forEach { language, device in withEnvironment(apiService: mockService) { let controller = RewardAddOnSelectionViewController.instantiate() let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -218,13 +214,6 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { self.scheduler.advance() - controller.pledgeShippingLocationViewController( - PledgeShippingLocationViewController.instantiate(), - didSelect: shippingRule - ) - - self.scheduler.advance(by: .seconds(1)) - assertSnapshot( matching: parent.view, as: .image(perceptualPrecision: 0.98), @@ -242,13 +231,14 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { let mockService = MockService(fetchRewardAddOnsSelectionViewRewardsResult: .failure(.couldNotParseJSON)) - combos(Language.allLanguages, Device.allCases).forEach { language, device in + orthogonalCombos(Language.allLanguages, Device.allCases).forEach { language, device in withEnvironment(apiService: mockService) { let controller = RewardAddOnSelectionViewController.instantiate() let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -288,13 +278,14 @@ final class RewardAddOnSelectionViewControllerTests: TestCase { let mockService = MockService(fetchRewardAddOnsSelectionViewRewardsResult: .success(project)) - combos(Language.allLanguages, [Device.phone5_8inch, Device.pad]).forEach { language, device in + orthogonalCombos(Language.allLanguages, [Device.phone5_8inch, Device.pad]).forEach { language, device in withEnvironment(apiService: mockService, language: language) { let controller = RewardAddOnSelectionViewController.instantiate() let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4inch.png index 71d7a97a20..be6074023c 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone4inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_de_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4_7inch.png index 4a5d77e44a..ce7a27e1ab 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4_7inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4_7inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_en_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_5inch.png index f9fee955c2..16beab10ed 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_5inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_5inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_es_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_8inch.png index 4a5d77e44a..ce7a27e1ab 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_fr_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_pad.png index 2eeda68adf..563c47a6c5 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_EmptyState.lang_ja_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_pad.png deleted file mode 100644 index c94c9a4bd0..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4_7inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4inch.png index 0b692e76b3..cb386ca99c 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone4inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_5inch.png deleted file mode 100644 index 024ef7b991..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_8inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_de_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_pad.png deleted file mode 100644 index c94c9a4bd0..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4_7inch.png index 41a18b180c..ae374817f1 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4_7inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4_7inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4inch.png deleted file mode 100644 index 0b692e76b3..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_5inch.png deleted file mode 100644 index 024ef7b991..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_8inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_en_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_pad.png deleted file mode 100644 index c94c9a4bd0..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4_7inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4inch.png deleted file mode 100644 index 0b692e76b3..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_5inch.png index 024ef7b991..094b26306f 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_5inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_5inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_8inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_es_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_pad.png deleted file mode 100644 index c94c9a4bd0..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4_7inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4inch.png deleted file mode 100644 index 0b692e76b3..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_5inch.png deleted file mode 100644 index 024ef7b991..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_8inch.png index 41a18b180c..ae374817f1 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_fr_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_pad.png index c94c9a4bd0..bd50ebc607 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4_7inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4inch.png deleted file mode 100644 index 0b692e76b3..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_5inch.png deleted file mode 100644 index 024ef7b991..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_8inch.png deleted file mode 100644 index 41a18b180c..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Error.lang_ja_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_pad.png deleted file mode 100644 index e0457e3637..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4_7inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4inch.png index 20b78d0507..54a5b0d71a 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone4inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_5inch.png deleted file mode 100644 index 6d0a864487..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_8inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_de_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_pad.png deleted file mode 100644 index e0457e3637..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4_7inch.png index 162c5a978b..064bcc7e81 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4_7inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4_7inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4inch.png deleted file mode 100644 index 20b78d0507..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_5inch.png deleted file mode 100644 index 6d0a864487..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_8inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_en_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_pad.png deleted file mode 100644 index e0457e3637..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4_7inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4inch.png deleted file mode 100644 index 20b78d0507..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_5inch.png index 6d0a864487..d20448b0c8 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_5inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_5inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_8inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_es_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_pad.png deleted file mode 100644 index e0457e3637..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4_7inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4inch.png deleted file mode 100644 index 20b78d0507..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_5inch.png deleted file mode 100644 index 6d0a864487..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_8inch.png index 162c5a978b..064bcc7e81 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_fr_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_pad.png index e0457e3637..635a20d661 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4_7inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4inch.png deleted file mode 100644 index 20b78d0507..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_5inch.png deleted file mode 100644 index 6d0a864487..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_8inch.png deleted file mode 100644 index 162c5a978b..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShipping.lang_ja_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_pad.png deleted file mode 100644 index 4788c226aa..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_phone5_8inch.png index 9678cbaf78..b06ae9aa20 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_de_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_pad.png index af787b7e1d..ae5ff0e695 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_phone5_8inch.png deleted file mode 100644 index e97d77b0e0..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_en_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_pad.png deleted file mode 100644 index 10dc500556..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_phone5_8inch.png index e1cbffa18b..64d4e47c11 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_es_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_pad.png index 10b03acd1e..cb829f7039 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_phone5_8inch.png deleted file mode 100644 index 0ab3bc94f2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_fr_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_pad.png deleted file mode 100644 index 7f3a361348..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_phone5_8inch.png index ebfb59677a..6bfdefe383 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_NoShippingWithLocalPickup_Success.lang_ja_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4inch.png index 71d7a97a20..be6074023c 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone4inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_de_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4_7inch.png index 4a5d77e44a..ce7a27e1ab 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4_7inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4_7inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_en_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_5inch.png index f9fee955c2..16beab10ed 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_5inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_5inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_es_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_pad.png deleted file mode 100644 index 2eeda68adf..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_pad.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_8inch.png index 4a5d77e44a..ce7a27e1ab 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_8inch.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_fr_device_phone5_8inch.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_pad.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_pad.png index 2eeda68adf..563c47a6c5 100644 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_pad.png and b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_pad.png differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4_7inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4_7inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4_7inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4inch.png deleted file mode 100644 index 71d7a97a20..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone4inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_5inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_5inch.png deleted file mode 100644 index f9fee955c2..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_5inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_8inch.png b/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_8inch.png deleted file mode 100644 index 4a5d77e44a..0000000000 Binary files a/Kickstarter-iOS/Features/RewardAddOnSelection/Controller/__Snapshots__/RewardAddOnSelectionViewControllerTests/testView_Shipping.lang_ja_device_phone5_8inch.png and /dev/null differ diff --git a/Kickstarter-iOS/Features/RewardsCollection/Controller/RewardsCollectionViewController.swift b/Kickstarter-iOS/Features/RewardsCollection/Controller/RewardsCollectionViewController.swift index 2730c805e4..ab13dbf4b5 100644 --- a/Kickstarter-iOS/Features/RewardsCollection/Controller/RewardsCollectionViewController.swift +++ b/Kickstarter-iOS/Features/RewardsCollection/Controller/RewardsCollectionViewController.swift @@ -100,6 +100,7 @@ final class RewardsCollectionViewController: UICollectionViewController { self.setupConstraints() self.viewModel.inputs.viewDidLoad() + self.viewModel.inputs.shippingRuleSelected(nil) } override func viewDidAppear(_ animated: Bool) { @@ -389,11 +390,15 @@ extension RewardsCollectionViewController: RewardCellDelegate { extension RewardsCollectionViewController: PledgeShippingLocationViewControllerDelegate { func pledgeShippingLocationViewController( _: PledgeShippingLocationViewController, - didSelect _: ShippingRule - ) {} + didSelect shippingRule: ShippingRule + ) { + self.viewModel.inputs.shippingRuleSelected(shippingRule) + } func pledgeShippingLocationViewControllerLayoutDidUpdate(_: PledgeShippingLocationViewController) {} - func pledgeShippingLocationViewControllerFailedToLoad(_: PledgeShippingLocationViewController) {} + func pledgeShippingLocationViewControllerFailedToLoad(_: PledgeShippingLocationViewController) { + self.viewModel.inputs.shippingLocationViewDidFailToLoad() + } } // MARK: Styles diff --git a/Library/ViewModels/ConfirmDetailsViewModelTests.swift b/Library/ViewModels/ConfirmDetailsViewModelTests.swift index 4507fe9def..8107ed03e0 100644 --- a/Library/ViewModels/ConfirmDetailsViewModelTests.swift +++ b/Library/ViewModels/ConfirmDetailsViewModelTests.swift @@ -35,6 +35,9 @@ final class ConfirmDetailsViewModelTests: TestCase { private let showErrorBannerWithMessage = TestObserver() + let shippingRule = ShippingRule.template + |> ShippingRule.lens.location .~ (.template |> Location.lens.id .~ 55) + override func setUp() { super.setUp() @@ -76,6 +79,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: Project.template, rewards: [Reward.template], + selectedShippingRule: self.shippingRule, selectedQuantities: [Reward.template.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -108,6 +112,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: Project.template, rewards: [Reward.template], + selectedShippingRule: self.shippingRule, selectedQuantities: [Reward.template.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -155,7 +160,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -188,7 +194,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -218,7 +225,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -247,7 +255,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -274,7 +283,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -301,7 +311,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -328,7 +339,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -364,7 +376,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -413,7 +426,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -465,7 +479,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, context: .pledge @@ -528,7 +543,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, context: .pledge @@ -553,7 +569,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, context: .pledge @@ -578,7 +595,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, context: .pledge @@ -605,6 +623,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -635,6 +654,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -662,7 +682,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, context: .pledge @@ -690,7 +711,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], - selectedQuantities: [reward.id: 1], + + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, context: .pledge @@ -721,6 +743,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -751,6 +774,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -790,6 +814,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -833,6 +858,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1, addOnReward2], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1, addOnReward2.id: 2], selectedLocationId: shippingRule.location.id, refTag: nil, @@ -874,6 +900,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -916,7 +943,8 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: expectedRewards, - selectedQuantities: selectedQuantities, + + selectedShippingRule: shippingRule, selectedQuantities: selectedQuantities, selectedLocationId: ShippingRule.template.id, refTag: nil, context: .pledge @@ -992,6 +1020,7 @@ final class ConfirmDetailsViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: ShippingRule.template.id, refTag: nil, diff --git a/Library/ViewModels/ManagePledgeViewModel.swift b/Library/ViewModels/ManagePledgeViewModel.swift index dc7433a6ca..0aa5fdd7f1 100644 --- a/Library/ViewModels/ManagePledgeViewModel.swift +++ b/Library/ViewModels/ManagePledgeViewModel.swift @@ -446,6 +446,7 @@ private func pledgeViewData( return PledgeViewData( project: project, rewards: rewards, + selectedShippingRule: nil, selectedQuantities: selectedRewardQuantities(in: backing), selectedLocationId: backing.locationId, refTag: nil, diff --git a/Library/ViewModels/ManagePledgeViewModelTests.swift b/Library/ViewModels/ManagePledgeViewModelTests.swift index 9fcfd5ef72..b528575366 100644 --- a/Library/ViewModels/ManagePledgeViewModelTests.swift +++ b/Library/ViewModels/ManagePledgeViewModelTests.swift @@ -503,6 +503,7 @@ internal final class ManagePledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: nil, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -626,6 +627,7 @@ internal final class ManagePledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: nil, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -679,6 +681,7 @@ internal final class ManagePledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [baseReward, addOn1, addOn2], + selectedShippingRule: nil, selectedQuantities: [baseReward.id: 1, addOn1.id: 1, addOn2.id: 2], selectedLocationId: nil, refTag: nil, @@ -1431,6 +1434,7 @@ internal final class ManagePledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: nil, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, diff --git a/Library/ViewModels/PledgeShippingLocationViewModel.swift b/Library/ViewModels/PledgeShippingLocationViewModel.swift index f33de47cf7..fe5dcb914e 100644 --- a/Library/ViewModels/PledgeShippingLocationViewModel.swift +++ b/Library/ViewModels/PledgeShippingLocationViewModel.swift @@ -200,7 +200,7 @@ private func getRewardIDsToQuery(for project: Project) -> Set { if rewardIDsToQuery.isEmpty { let restrictedRewards = project.rewards .filter { - ($0.isRestrictedShippingPreference || $0.isLocalShippingPreference || $0.hasNoShippingPreference) + ($0.isRestrictedShippingPreference || $0.hasNoShippingPreference) && $0.shipping.enabled } diff --git a/Library/ViewModels/PledgeViewModel.swift b/Library/ViewModels/PledgeViewModel.swift index df85b1138a..6efebaeb6d 100644 --- a/Library/ViewModels/PledgeViewModel.swift +++ b/Library/ViewModels/PledgeViewModel.swift @@ -39,6 +39,7 @@ public typealias PKPaymentData = (displayName: String, network: String, transact public struct PledgeViewData: Equatable { public let project: Project public let rewards: [Reward] + public let selectedShippingRule: ShippingRule? public let selectedQuantities: SelectedRewardQuantities public let selectedLocationId: Int? public let refTag: RefTag? diff --git a/Library/ViewModels/PledgeViewModelTests.swift b/Library/ViewModels/PledgeViewModelTests.swift index 55a90458f6..ffea40796b 100644 --- a/Library/ViewModels/PledgeViewModelTests.swift +++ b/Library/ViewModels/PledgeViewModelTests.swift @@ -82,6 +82,9 @@ final class PledgeViewModelTests: TestCase { private let rootStackViewLayoutMargins = TestObserver() private let title = TestObserver() + let shippingRule = ShippingRule.template + |> ShippingRule.lens.location .~ (.template |> Location.lens.id .~ 55) + override func setUp() { super.setUp() @@ -210,6 +213,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -272,6 +276,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -299,6 +304,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -359,6 +365,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -419,6 +426,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -489,6 +497,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: shippingRule.location.id, refTag: .projectPage, @@ -575,6 +584,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: shippingRule.location.id, refTag: .projectPage, @@ -660,6 +670,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -726,6 +737,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -766,6 +778,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -807,6 +820,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -847,6 +861,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -887,6 +902,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -936,6 +952,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -998,6 +1015,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1061,6 +1079,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1119,6 +1138,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1231,6 +1251,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1258,6 +1279,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -1281,6 +1303,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1322,6 +1345,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1366,6 +1390,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1400,6 +1425,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1430,6 +1456,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1462,6 +1489,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1499,6 +1527,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1528,6 +1557,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1559,6 +1589,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1587,6 +1618,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1618,6 +1650,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1660,6 +1693,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1750,6 +1784,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1845,6 +1880,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -1929,6 +1965,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -1976,6 +2013,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -2064,6 +2102,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOn1, addOn2], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOn1.id: 2, addOn2.id: 1], selectedLocationId: shippingRule.location.id, refTag: .activity, @@ -2163,6 +2202,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 2, addOnReward2.id: 1], selectedLocationId: nil, refTag: .activity, @@ -2244,6 +2284,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -2332,6 +2373,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -2415,6 +2457,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -2507,6 +2550,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: shippingRule.location.id, refTag: .discovery, @@ -2593,6 +2637,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: shippingRule.location.id, refTag: .discovery, @@ -2668,6 +2713,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -2736,6 +2782,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -2812,6 +2859,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .discovery, @@ -2907,6 +2955,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1, addOnReward2], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 2, addOnReward2.id: 1], selectedLocationId: shippingRule.location.id, refTag: .projectPage, @@ -2986,6 +3035,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -3155,6 +3205,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -3290,6 +3341,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -3442,6 +3494,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -3708,6 +3761,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -3933,6 +3987,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -4144,6 +4199,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .projectPage, @@ -4324,6 +4380,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .activity, @@ -4447,6 +4504,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: defaultShippingRule.location.id, refTag: .activity, @@ -4548,6 +4606,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -4656,6 +4715,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -4760,6 +4820,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -4864,6 +4925,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -4927,6 +4989,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -4952,6 +5015,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -4977,6 +5041,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5004,6 +5069,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -5034,6 +5100,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -5061,6 +5128,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5089,6 +5157,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5120,6 +5189,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: nil, refTag: nil, @@ -5150,6 +5220,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -5189,6 +5260,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -5232,6 +5304,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1, addOnReward2], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1, addOnReward2.id: 2], selectedLocationId: shippingRule.location.id, refTag: nil, @@ -5272,6 +5345,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, addOnReward1], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1], selectedLocationId: shippingRule.id, refTag: nil, @@ -5295,6 +5369,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -5316,6 +5391,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -5354,6 +5430,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 2, addOnReward2.id: 1], selectedLocationId: nil, refTag: .activity, @@ -5451,6 +5528,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1, addOnReward1.id: 1, addOnReward2.id: 1], selectedLocationId: nil, refTag: .projectPage, @@ -5541,6 +5619,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5561,6 +5640,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5585,6 +5665,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5628,6 +5709,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -5685,6 +5767,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -5737,6 +5820,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -5775,6 +5859,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .discovery, @@ -5856,6 +5941,7 @@ final class PledgeViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, diff --git a/Library/ViewModels/RewardAddOnSelectionViewModel.swift b/Library/ViewModels/RewardAddOnSelectionViewModel.swift index 3bb9465958..e501753538 100644 --- a/Library/ViewModels/RewardAddOnSelectionViewModel.swift +++ b/Library/ViewModels/RewardAddOnSelectionViewModel.swift @@ -30,21 +30,16 @@ public protocol RewardAddOnSelectionViewModelInputs { func configure(with data: PledgeViewData) func continueButtonTapped() func rewardAddOnCardViewDidSelectQuantity(quantity: Int, rewardId: Int) - func shippingLocationViewDidFailToLoad() - func shippingRuleSelected(_ shippingRule: ShippingRule) func viewDidLoad() } public protocol RewardAddOnSelectionViewModelOutputs { var configureContinueCTAViewWithData: Signal { get } - var configurePledgeShippingLocationViewControllerWithData: - Signal { get } var endRefreshing: Signal<(), Never> { get } var goToPledge: Signal { get } var loadAddOnRewardsIntoDataSource: Signal<[RewardAddOnSelectionDataSourceItem], Never> { get } var loadAddOnRewardsIntoDataSourceAndReloadTableView: Signal<[RewardAddOnSelectionDataSourceItem], Never> { get } - var shippingLocationViewIsHidden: Signal { get } var startRefreshing: Signal<(), Never> { get } } @@ -68,17 +63,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT let refTag = configData.map(\.refTag) let context = configData.map(\.context) let initialLocationId = configData.map(\.selectedLocationId) - - let shippingLocationViewConfigData = Signal.zip(project, baseReward, initialLocationId) - - let fetchShippingLocations = Signal.merge( - shippingLocationViewConfigData, - shippingLocationViewConfigData.takeWhen(self.beginRefreshSignal) - ) - .filter { _, reward, _ in reward.shipping.enabled } - - self.configurePledgeShippingLocationViewControllerWithData = fetchShippingLocations - .map { project, reward, initialLocationId in (project, reward, false, initialLocationId) } + let selectedShippingRule = configData.map(\.selectedShippingRule) let slug = project.map(\.slug) @@ -88,7 +73,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT ) let shippingRule = Signal.merge( - self.shippingRuleSelectedProperty.signal, + selectedShippingRule, baseReward.filter { reward in !reward.shipping.enabled }.mapConst(nil) ) @@ -175,19 +160,6 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT .map(unpack) .map(rewardsData) - self.shippingLocationViewIsHidden = Signal.merge( - baseReward.map(\.shipping.enabled).negate(), - self.shippingLocationViewDidFailToLoadProperty.signal.mapConst(true), - fetchShippingLocations.mapConst(false) - ) - .combineLatest(with: baseReward) - .switchMap { flag, baseReward -> SignalProducer in - let shippingLocationViewHidden = isRewardLocalPickup(baseReward) ? true : flag - - return SignalProducer(value: shippingLocationViewHidden) - } - .skipRepeats() - let dataSourceItems = Signal.merge( self.loadAddOnRewardsIntoDataSourceAndReloadTableView, self.loadAddOnRewardsIntoDataSource @@ -248,6 +220,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT self.goToPledge = Signal.combineLatest( project, selectedRewards, + shippingRule, selectedQuantities, selectedLocationId, refTag, @@ -256,21 +229,6 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT .map(PledgeViewData.init) .takeWhen(self.continueButtonTappedProperty.signal) - let shippingTotal = Signal.combineLatest( - shippingRule.skipNil(), - selectedRewards, - selectedQuantities - ) - .map(calculateShippingTotal) - - let baseRewardShippingTotal = Signal.zip(project, baseReward, shippingRule) - .map(getBaseRewardShippingTotal) - - let allRewardsShippingTotal = Signal.merge( - baseRewardShippingTotal, - shippingTotal - ) - // Additional pledge amount is zero if not backed. let additionalPledgeAmount = Signal.merge( configData.filter { $0.project.personalization.backing == nil }.mapConst(0.0), @@ -285,7 +243,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT let combinedPledgeTotal = Signal.combineLatest( additionalPledgeAmount, - allRewardsShippingTotal, + additionalPledgeAmount.mapConst(0), allRewardsTotal ) .map(calculatePledgeTotal) @@ -305,12 +263,11 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT refTag, configData, additionalPledgeAmount, - allRewardsShippingTotal, pledgeTotal ) .take(first: 1) .observeForUI() - .observeValues { project, baseReward, selectedRewards, refTag, configData, additionalPledgeAmount, shippingTotal, pledgeTotal in + .observeValues { project, baseReward, selectedRewards, refTag, configData, additionalPledgeAmount, pledgeTotal in let checkoutPropertiesData = checkoutProperties( from: project, baseReward: baseReward, @@ -318,7 +275,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT selectedQuantities: configData.selectedQuantities, additionalPledgeAmount: additionalPledgeAmount, pledgeTotal: pledgeTotal, - shippingTotal: shippingTotal, + shippingTotal: 0, isApplePay: nil ) @@ -338,10 +295,9 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT selectedQuantities, additionalPledgeAmount, pledgeTotal, - allRewardsShippingTotal, refTag ).takeWhen(self.continueButtonTappedProperty.signal) - .observeValues { project, baseReward, selectedRewards, selectedQuantities, additionalPledgeAmount, pledgeTotal, shippingTotal, refTag in + .observeValues { project, baseReward, selectedRewards, selectedQuantities, additionalPledgeAmount, pledgeTotal, refTag in let checkoutData = checkoutProperties( from: project, @@ -350,7 +306,7 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT selectedQuantities: selectedQuantities, additionalPledgeAmount: additionalPledgeAmount, pledgeTotal: pledgeTotal, - shippingTotal: shippingTotal, + shippingTotal: 0, isApplePay: nil ) @@ -392,25 +348,12 @@ public final class RewardAddOnSelectionViewModel: RewardAddOnSelectionViewModelT self.rewardAddOnCardViewDidSelectQuantityProperty.value = (quantity, rewardId) } - private let shippingLocationViewDidFailToLoadProperty = MutableProperty(()) - public func shippingLocationViewDidFailToLoad() { - self.shippingLocationViewDidFailToLoadProperty.value = () - } - - private let shippingRuleSelectedProperty = MutableProperty(nil) - public func shippingRuleSelected(_ shippingRule: ShippingRule) { - self.shippingRuleSelectedProperty.value = shippingRule - } - public let configureContinueCTAViewWithData: Signal - public let configurePledgeShippingLocationViewControllerWithData: - Signal public let endRefreshing: Signal<(), Never> public let goToPledge: Signal public let loadAddOnRewardsIntoDataSource: Signal<[RewardAddOnSelectionDataSourceItem], Never> public let loadAddOnRewardsIntoDataSourceAndReloadTableView: Signal<[RewardAddOnSelectionDataSourceItem], Never> - public let shippingLocationViewIsHidden: Signal public let startRefreshing: Signal<(), Never> public var inputs: RewardAddOnSelectionViewModelInputs { return self } diff --git a/Library/ViewModels/RewardAddOnSelectionViewModelTests.swift b/Library/ViewModels/RewardAddOnSelectionViewModelTests.swift index 8605bb8683..6f2b96e089 100644 --- a/Library/ViewModels/RewardAddOnSelectionViewModelTests.swift +++ b/Library/ViewModels/RewardAddOnSelectionViewModelTests.swift @@ -12,17 +12,11 @@ final class RewardAddOnSelectionViewModelTests: TestCase { private let configureContinueCTAViewWithDataIsLoading = TestObserver() private let configureContinueCTAViewWithDataIsValid = TestObserver() private let configureContinueCTAViewWithDataQuantity = TestObserver() - private let configurePledgeShippingLocationViewControllerWithDataProject = TestObserver() - private let configurePledgeShippingLocationViewControllerWithDataReward = TestObserver() - private let configurePledgeShippingLocationViewControllerWithDataShowAmount = TestObserver() - private let configurePledgeShippingLocationViewControllerWithDataSelectedLocationId - = TestObserver() private let endRefreshing = TestObserver<(), Never>() private let goToPledge = TestObserver() private let loadAddOnRewardsIntoDataSource = TestObserver<[RewardAddOnSelectionDataSourceItem], Never>() private let loadAddOnRewardsIntoDataSourceAndReloadTableView = TestObserver<[RewardAddOnSelectionDataSourceItem], Never>() - private let shippingLocationViewIsHidden = TestObserver() private let startRefreshing = TestObserver<(), Never>() override func setUp() { @@ -34,128 +28,14 @@ final class RewardAddOnSelectionViewModelTests: TestCase { .observe(self.configureContinueCTAViewWithDataIsValid.observer) self.vm.outputs.configureContinueCTAViewWithData.map(third) .observe(self.configureContinueCTAViewWithDataIsLoading.observer) - self.vm.outputs.configurePledgeShippingLocationViewControllerWithData.map { $0.0 } - .observe(self.configurePledgeShippingLocationViewControllerWithDataProject.observer) - self.vm.outputs.configurePledgeShippingLocationViewControllerWithData.map { $0.1 } - .observe(self.configurePledgeShippingLocationViewControllerWithDataReward.observer) - self.vm.outputs.configurePledgeShippingLocationViewControllerWithData.map { $0.2 } - .observe(self.configurePledgeShippingLocationViewControllerWithDataShowAmount.observer) - self.vm.outputs.configurePledgeShippingLocationViewControllerWithData.map { $0.3 } - .observe(self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.observer) self.vm.outputs.endRefreshing.observe(self.endRefreshing.observer) self.vm.outputs.goToPledge.observe(self.goToPledge.observer) self.vm.outputs.loadAddOnRewardsIntoDataSource.observe(self.loadAddOnRewardsIntoDataSource.observer) self.vm.outputs.loadAddOnRewardsIntoDataSourceAndReloadTableView .observe(self.loadAddOnRewardsIntoDataSourceAndReloadTableView.observer) - self.vm.outputs.shippingLocationViewIsHidden.observe(self.shippingLocationViewIsHidden.observer) self.vm.outputs.startRefreshing.observe(self.startRefreshing.observer) } - func testConfigurePledgeShippingLocationViewControllerWithData_ShippingEnabled() { - self.configurePledgeShippingLocationViewControllerWithDataProject.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataReward.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertDidNotEmitValue() - - let reward = Reward.template - |> Reward.lens.shipping.enabled .~ true - - let project = Project.template - - let data = PledgeViewData( - project: project, - rewards: [reward], - selectedQuantities: [:], - selectedLocationId: 2, - refTag: nil, - context: .pledge - ) - - self.vm.inputs.configure(with: data) - self.vm.inputs.viewDidLoad() - - self.configurePledgeShippingLocationViewControllerWithDataProject.assertValues([project]) - self.configurePledgeShippingLocationViewControllerWithDataReward.assertValues([reward]) - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertValues([false]) - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertValues([2]) - } - - func testConfigurePledgeShippingLocationViewControllerWithData_ShippingDisabled() { - self.configurePledgeShippingLocationViewControllerWithDataProject.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataReward.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertDidNotEmitValue() - - let reward = Reward.template - |> Reward.lens.shipping.enabled .~ false - - let project = Project.template - - let data = PledgeViewData( - project: project, - rewards: [reward], - selectedQuantities: [:], - selectedLocationId: 2, - refTag: nil, - context: .pledge - ) - - self.vm.inputs.configure(with: data) - self.vm.inputs.viewDidLoad() - - self.configurePledgeShippingLocationViewControllerWithDataProject.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataReward.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertDidNotEmitValue() - } - - func testConfigurePledgeShippingLocationViewControllerWithData_ShippingEnabled_FailedThenRefreshed() { - self.configurePledgeShippingLocationViewControllerWithDataProject.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataReward.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertDidNotEmitValue() - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertDidNotEmitValue() - self.shippingLocationViewIsHidden.assertDidNotEmitValue() - - let reward = Reward.template - |> Reward.lens.shipping.enabled .~ true - - let project = Project.template - - let data = PledgeViewData( - project: project, - rewards: [reward], - selectedQuantities: [:], - selectedLocationId: 2, - refTag: nil, - context: .pledge - ) - - self.vm.inputs.configure(with: data) - self.vm.inputs.viewDidLoad() - - self.configurePledgeShippingLocationViewControllerWithDataProject.assertValues([project]) - self.configurePledgeShippingLocationViewControllerWithDataReward.assertValues([reward]) - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertValues([false]) - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertValues([2]) - self.shippingLocationViewIsHidden.assertValues([false]) - - self.vm.inputs.shippingLocationViewDidFailToLoad() - - self.configurePledgeShippingLocationViewControllerWithDataProject.assertValues([project]) - self.configurePledgeShippingLocationViewControllerWithDataReward.assertValues([reward]) - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertValues([false]) - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertValues([2]) - self.shippingLocationViewIsHidden.assertValues([false, true]) - - self.vm.inputs.beginRefresh() - - self.configurePledgeShippingLocationViewControllerWithDataProject.assertValues([project, project]) - self.configurePledgeShippingLocationViewControllerWithDataReward.assertValues([reward, reward]) - self.configurePledgeShippingLocationViewControllerWithDataShowAmount.assertValues([false, false]) - self.configurePledgeShippingLocationViewControllerWithDataSelectedLocationId.assertValues([2, 2]) - self.shippingLocationViewIsHidden.assertValues([false, true, false]) - } - func testLoadAddOnRewardsIntoDataSource() { self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertDidNotEmitValue() @@ -184,6 +64,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -199,9 +80,12 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() self.startRefreshing.assertValueCount(0) - self.endRefreshing.assertValueCount(1) + self.endRefreshing.assertValueCount(2) - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([[.rewardAddOn(expected)]]) + self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([ + [.rewardAddOn(expected)], + [.rewardAddOn(expected)] + ]) } } @@ -228,6 +112,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -239,7 +124,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([]) + self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([[.emptyState(.addOnsUnavailable)]]) } } @@ -255,6 +140,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -290,6 +176,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -305,7 +192,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() self.startRefreshing.assertValueCount(0) - self.endRefreshing.assertValueCount(1) + self.endRefreshing.assertValueCount(2) self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([[.emptyState(.errorPullToRefresh)]]) } @@ -324,12 +211,12 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.vm.inputs.beginRefresh() self.startRefreshing.assertValueCount(1) - self.endRefreshing.assertValueCount(1) + self.endRefreshing.assertValueCount(2) self.scheduler.advance() self.startRefreshing.assertValueCount(1) - self.endRefreshing.assertValueCount(2) + self.endRefreshing.assertValueCount(3) self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([ [.emptyState(.errorPullToRefresh)], @@ -383,6 +270,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward, noShippingAddOn], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -394,7 +282,10 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([[.rewardAddOn(expected)]]) + self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([ + [.rewardAddOn(expected)], + [.rewardAddOn(expected)] + ]) XCTAssertEqual( self.loadAddOnRewardsIntoDataSourceAndReloadTableView.values.last?.count, 1, "Only the single add-on reward without shipping is emitted for no-shipping base reward." @@ -517,6 +408,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [baseReward], + selectedShippingRule: ShippingRule.template, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -528,7 +420,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected]) + self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected, expected]) } } @@ -611,6 +503,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -626,10 +519,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) - - self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected]) XCTAssertEqual( self.loadAddOnRewardsIntoDataSourceAndReloadTableView.values.last?.count, 4, @@ -715,6 +604,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -730,10 +620,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) - - self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected]) XCTAssertEqual( self.loadAddOnRewardsIntoDataSourceAndReloadTableView.values.last?.count, 3, @@ -817,6 +703,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -832,10 +719,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) - - self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected]) XCTAssertEqual( self.loadAddOnRewardsIntoDataSourceAndReloadTableView.values.last?.count, 2, @@ -914,6 +797,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -929,10 +813,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) - - self.scheduler.advance() - self.loadAddOnRewardsIntoDataSource.assertDidNotEmitValue() self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertValues([expected]) XCTAssertEqual( @@ -1047,6 +927,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [:], selectedLocationId: nil, refTag: nil, @@ -1056,14 +937,10 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.vm.inputs.configure(with: data) self.vm.inputs.viewDidLoad() - self.scheduler.advance() - self.loadAddOnRewardsIntoDataSourceAndReloadTableView.assertDidNotEmitValue( "Nothing is emitted until a shipping location is selected" ) - self.vm.inputs.shippingRuleSelected(shippingRule) - self.scheduler.advance() self.loadAddOnRewardsIntoDataSource.assertDidNotEmitValue() @@ -1094,52 +971,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { } } - func testShippingLocationViewIsHidden_RewardHasShipping() { - self.shippingLocationViewIsHidden.assertDidNotEmitValue() - - let reward = Reward.template - |> Reward.lens.shipping.enabled .~ true - let project = Project.template - - let data = PledgeViewData( - project: project, - rewards: [reward], - selectedQuantities: [reward.id: 1], - selectedLocationId: nil, - refTag: nil, - context: .pledge - ) - - self.vm.inputs.configure(with: data) - self.vm.inputs.viewDidLoad() - - self.shippingLocationViewIsHidden.assertValues([false]) - } - - func testShippingLocationViewIsHidden_NoShipping() { - self.shippingLocationViewIsHidden.assertDidNotEmitValue() - - let reward = Reward.template - |> Reward.lens.shipping .~ ( - .template |> Reward.Shipping.lens.enabled .~ false - ) - let project = Project.template - - let data = PledgeViewData( - project: project, - rewards: [reward], - selectedQuantities: [reward.id: 1], - selectedLocationId: nil, - refTag: nil, - context: .pledge - ) - - self.vm.inputs.configure(with: data) - self.vm.inputs.viewDidLoad() - - self.shippingLocationViewIsHidden.assertValues([true]) - } - func testGoToPledge_AddOnsSkipped() { let shippingRule = ShippingRule.template |> ShippingRule.lens.location .~ (.template |> Location.lens.id .~ 99) @@ -1185,6 +1016,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: nil, @@ -1194,8 +1026,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.vm.inputs.configure(with: data) self.vm.inputs.viewDidLoad() - self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) self.scheduler.advance() XCTAssertEqual(["Page Viewed"], self.segmentTrackingClient.events) @@ -1215,6 +1045,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let expectedGoToPledgeData = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: shippingRule.location.id, refTag: nil, @@ -1273,6 +1104,7 @@ final class RewardAddOnSelectionViewModelTests: TestCase { let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -1282,8 +1114,6 @@ final class RewardAddOnSelectionViewModelTests: TestCase { self.vm.inputs.configure(with: data) self.vm.inputs.viewDidLoad() - self.scheduler.advance() - self.vm.inputs.shippingRuleSelected(shippingRule) self.scheduler.advance() XCTAssertEqual(["Page Viewed"], self.segmentTrackingClient.events) diff --git a/Library/ViewModels/RewardsCollectionViewModel.swift b/Library/ViewModels/RewardsCollectionViewModel.swift index 689d5be675..a2390b3a6e 100644 --- a/Library/ViewModels/RewardsCollectionViewModel.swift +++ b/Library/ViewModels/RewardsCollectionViewModel.swift @@ -13,7 +13,8 @@ public protocol RewardsCollectionViewModelInputs { func confirmedEditReward() func rewardCellShouldShowDividerLine(_ show: Bool) func rewardSelected(with rewardId: Int) - func shippingRuleSelected(_ shippingRule: ShippingRule) + func shippingLocationViewDidFailToLoad() + func shippingRuleSelected(_ shippingRule: ShippingRule?) func traitCollectionDidChange(_ traitCollection: UITraitCollection) func viewDidAppear() func viewDidLayoutSubviews() @@ -114,12 +115,14 @@ public final class RewardsCollectionViewModel: RewardsCollectionViewModelType, let goToPledge: Signal<(PledgeViewData, Bool), Never> = Signal.combineLatest( project, selectedRewardFromId, - refTag + refTag, + self.shippingRuleSelectedSignal.signal ) - .filter { project, reward, _ in + .takeWhen(self.rewardSelectedWithRewardIdProperty.signal) + .filter { project, reward, _, _ in rewardsCarouselCanNavigateToReward(reward, in: project) } - .map { project, reward, refTag -> (PledgeViewData, Bool) in + .map { project, reward, refTag, selectedShippingRule -> (PledgeViewData, Bool) in let pledgeContext = featurePostCampaignPledgeEnabled() && project.isInPostCampaignPledgingPhase ? PledgeViewContext.latePledge @@ -127,6 +130,7 @@ public final class RewardsCollectionViewModel: RewardsCollectionViewModelType, let data = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: selectedShippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, // Set during add-ons selection. refTag: refTag, @@ -319,8 +323,13 @@ public final class RewardsCollectionViewModel: RewardsCollectionViewModelType, self.rewardSelectedWithRewardIdProperty.value = rewardId } - private let (shippingRuleSelectedSignal, shippingRuleSelectedObserver) = Signal.pipe() - public func shippingRuleSelected(_ shippingRule: ShippingRule) { + private let shippingLocationViewDidFailToLoadProperty = MutableProperty(()) + public func shippingLocationViewDidFailToLoad() { + self.shippingLocationViewDidFailToLoadProperty.value = () + } + + private let (shippingRuleSelectedSignal, shippingRuleSelectedObserver) = Signal.pipe() + public func shippingRuleSelected(_ shippingRule: ShippingRule?) { self.shippingRuleSelectedObserver.send(value: shippingRule) } diff --git a/Library/ViewModels/RewardsCollectionViewModelTests.swift b/Library/ViewModels/RewardsCollectionViewModelTests.swift index d5cda1b816..aaac379aca 100644 --- a/Library/ViewModels/RewardsCollectionViewModelTests.swift +++ b/Library/ViewModels/RewardsCollectionViewModelTests.swift @@ -23,6 +23,16 @@ final class RewardsCollectionViewModelTests: TestCase { private let showEditRewardConfirmationPromptTitle = TestObserver() private let title = TestObserver() + private let configureShippingLocationViewWithDataProject = TestObserver() + private let configureShippingLocationViewWithDataReward = TestObserver() + private let configureShippingLocationViewWithDataShowAmount = TestObserver() + private let configureShippingLocationViewWithDataSelectedLocationId + = TestObserver() + private let shippingLocationViewHidden = TestObserver() + + let shippingRule = ShippingRule.template + |> ShippingRule.lens.location .~ (.template |> Location.lens.id .~ 55) + override func setUp() { super.setUp() @@ -45,6 +55,98 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.outputs.showEditRewardConfirmationPrompt.map(second) .observe(self.showEditRewardConfirmationPromptMessage.observer) self.vm.outputs.title.observe(self.title.observer) + + self.vm.outputs.configureShippingLocationViewWithData.map { $0.0 } + .observe(self.configureShippingLocationViewWithDataProject.observer) + self.vm.outputs.configureShippingLocationViewWithData.map { $0.1 } + .observe(self.configureShippingLocationViewWithDataReward.observer) + self.vm.outputs.configureShippingLocationViewWithData.map { $0.2 } + .observe(self.configureShippingLocationViewWithDataShowAmount.observer) + self.vm.outputs.configureShippingLocationViewWithData.map { $0.3 } + .observe(self.configureShippingLocationViewWithDataSelectedLocationId.observer) + self.vm.outputs.shippingLocationViewHidden.observe(self.shippingLocationViewHidden.observer) + } + + func testconfigureShippingLocationViewWithData_ShippingEnabled() { + self.configureShippingLocationViewWithDataProject.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataReward.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataShowAmount.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataSelectedLocationId.assertDidNotEmitValue() + + let reward = Reward.template + |> Reward.lens.shipping.enabled .~ true + |> Reward.lens.shipping.preference .~ .unrestricted + + let project = Project.template + |> Project.lens.rewardData.rewards .~ [reward] + + self.vm.inputs.configure(with: project, refTag: RefTag.category, context: .createPledge) + self.vm.inputs.viewDidLoad() + + self.configureShippingLocationViewWithDataProject.assertValues([project]) + self.configureShippingLocationViewWithDataReward.assertValues([reward]) + self.configureShippingLocationViewWithDataShowAmount.assertValues([false]) + self.shippingLocationViewHidden.assertValue(false) + self.configureShippingLocationViewWithDataSelectedLocationId.assertValues([nil]) + + self.vm.inputs.shippingRuleSelected(ShippingRule.template) + self.scheduler.advance() + + self.configureShippingLocationViewWithDataSelectedLocationId.assertValues([nil]) + } + + func testconfigureShippingLocationViewWithData_ShippingDisabled() { + self.configureShippingLocationViewWithDataProject.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataReward.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataShowAmount.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataSelectedLocationId.assertDidNotEmitValue() + + let reward = Reward.template + |> Reward.lens.shipping.enabled .~ false + + let project = Project.template + |> Project.lens.rewardData.rewards .~ [reward] + + self.vm.inputs.configure(with: project, refTag: RefTag.category, context: .createPledge) + self.vm.inputs.viewDidLoad() + + self.configureShippingLocationViewWithDataProject.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataReward.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataShowAmount.assertDidNotEmitValue() + self.configureShippingLocationViewWithDataSelectedLocationId.assertDidNotEmitValue() + self.shippingLocationViewHidden.assertValue(true) + } + + func testShippingLocationViewHidden_RewardHasLocalShipping() { + self.shippingLocationViewHidden.assertDidNotEmitValue() + + let reward = Reward.template + |> Reward.lens.shipping.enabled .~ true + |> Reward.lens.shipping.preference .~ .local + + let project = Project.template + |> Project.lens.rewardData.rewards .~ [reward] + + self.vm.inputs.configure(with: project, refTag: RefTag.category, context: .createPledge) + self.vm.inputs.viewDidLoad() + + self.shippingLocationViewHidden.assertValues([true]) + } + + func testShippingLocationViewHidden_NoShipping() { + self.shippingLocationViewHidden.assertDidNotEmitValue() + + let reward = Reward.template + |> Reward.lens.shipping .~ ( + .template |> Reward.Shipping.lens.enabled .~ false + ) + let project = Project.template + |> Project.lens.rewardData.rewards .~ [reward] + + self.vm.inputs.configure(with: project, refTag: RefTag.category, context: .createPledge) + self.vm.inputs.viewDidLoad() + + self.shippingLocationViewHidden.assertValues([true]) } func testConfigureWithProject() { @@ -227,11 +329,14 @@ final class RewardsCollectionViewModelTests: TestCase { self.showEditRewardConfirmationPromptMessage.assertDidNotEmitValue() XCTAssertNil(self.vm.outputs.selectedReward()) + self.vm.inputs.shippingRuleSelected(self.shippingRule) + self.vm.inputs.rewardSelected(with: firstRewardId) let expected = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -321,6 +426,7 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.inputs.configure(with: project, refTag: .activity, context: .createPledge) self.vm.inputs.viewDidLoad() + self.vm.inputs.shippingRuleSelected(self.shippingRule) self.goToPledge.assertDidNotEmitValue() XCTAssertNil(self.vm.outputs.selectedReward()) @@ -328,6 +434,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected1 = PledgeViewData( project: project, rewards: [firstReward], + selectedShippingRule: shippingRule, selectedQuantities: [firstReward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -345,6 +452,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected2 = PledgeViewData( project: project, rewards: [secondReward], + selectedShippingRule: shippingRule, selectedQuantities: [secondReward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -376,6 +484,7 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.inputs.configure(with: project, refTag: .activity, context: .createPledge) self.vm.inputs.viewDidLoad() + self.vm.inputs.shippingRuleSelected(self.shippingRule) self.goToAddOnSelection.assertDidNotEmitValue() self.goToPledge.assertDidNotEmitValue() @@ -386,6 +495,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected1 = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -420,6 +530,7 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.inputs.configure(with: project, refTag: .activity, context: .createPledge) self.vm.inputs.viewDidLoad() + self.vm.inputs.shippingRuleSelected(self.shippingRule) self.goToAddOnSelection.assertDidNotEmitValue() self.goToPledge.assertDidNotEmitValue() @@ -430,6 +541,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected1 = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -465,6 +577,7 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.inputs.configure(with: project, refTag: .activity, context: .createPledge) self.vm.inputs.viewDidLoad() + self.vm.inputs.shippingRuleSelected(self.shippingRule) self.goToAddOnSelection.assertDidNotEmitValue() self.goToPledge.assertDidNotEmitValue() @@ -475,6 +588,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected1 = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity, @@ -526,6 +640,7 @@ final class RewardsCollectionViewModelTests: TestCase { self.vm.inputs.configure(with: project, refTag: .activity, context: .createPledge) self.vm.inputs.viewDidLoad() + self.vm.inputs.shippingRuleSelected(self.shippingRule) self.goToAddOnSelection.assertDidNotEmitValue() self.goToPledge.assertDidNotEmitValue() @@ -536,6 +651,7 @@ final class RewardsCollectionViewModelTests: TestCase { let expected1 = PledgeViewData( project: project, rewards: [reward], + selectedShippingRule: shippingRule, selectedQuantities: [reward.id: 1], selectedLocationId: nil, refTag: .activity,