-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add add button and stepper to reward add-on card (#1250)
- Loading branch information
1 parent
5be6f02
commit ecd880c
Showing
62 changed files
with
275 additions
and
78 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
Kickstarter-iOS/Assets.xcassets/icons/stepper-decrement-normal-grey.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "stepper-decrement-normal-grey.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
Binary file added
BIN
+1.28 KB
...s.xcassets/icons/stepper-decrement-normal-grey.imageset/stepper-decrement-normal-grey.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions
15
Kickstarter-iOS/Assets.xcassets/icons/stepper-increment-normal-grey.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "stepper-increment-normal-grey.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
Binary file added
BIN
+3.62 KB
...s.xcassets/icons/stepper-increment-normal-grey.imageset/stepper-increment-normal-grey.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
Kickstarter-iOS/Views/Controllers/RewardAddOnSelectionViewControllerTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@testable import Kickstarter_Framework | ||
@testable import KsApi | ||
@testable import Library | ||
import Prelude | ||
import UIKit | ||
|
||
final class RewardAddOnSelectionViewControllerTests: TestCase { | ||
override func setUp() { | ||
super.setUp() | ||
AppEnvironment.pushEnvironment(mainBundle: Bundle.framework) | ||
UIView.setAnimationsEnabled(false) | ||
} | ||
|
||
override func tearDown() { | ||
AppEnvironment.popEnvironment() | ||
UIView.setAnimationsEnabled(true) | ||
|
||
super.tearDown() | ||
} | ||
|
||
func testView_NoShipping() { | ||
let reward = Reward.template | ||
let project = Project.template | ||
let env = RewardAddOnSelectionViewEnvelope.template | ||
let mockService = MockService(fetchRewardAddOnsSelectionViewRewardsResult: .success(env)) | ||
|
||
combos(Language.allLanguages, Device.allCases).forEach { language, device in | ||
withEnvironment(apiService: mockService) { | ||
let controller = RewardAddOnSelectionViewController.instantiate() | ||
controller.configureWith(project: project, reward: reward, refTag: nil, context: .pledge) | ||
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller) | ||
parent.view.frame.size.height = 600 | ||
|
||
self.scheduler.advance() | ||
|
||
FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)") | ||
} | ||
} | ||
} | ||
|
||
func testView_Shipping() { | ||
let shippingRules = [ | ||
ShippingRule.template | ||
|> ShippingRule.lens.location .~ .brooklyn, | ||
ShippingRule.template | ||
|> ShippingRule.lens.location .~ .canada, | ||
ShippingRule.template | ||
|> ShippingRule.lens.location .~ .australia | ||
] | ||
|
||
let reward = Reward.template | ||
|> Reward.lens.shipping .~ ( | ||
.template |> Reward.Shipping.lens.enabled .~ true | ||
) | ||
let project = Project.template | ||
let env = RewardAddOnSelectionViewEnvelope.template | ||
let mockService = MockService( | ||
fetchShippingRulesResult: .success(shippingRules), | ||
fetchRewardAddOnsSelectionViewRewardsResult: .success(env) | ||
) | ||
|
||
combos(Language.allLanguages, Device.allCases).forEach { language, device in | ||
withEnvironment(apiService: mockService) { | ||
let controller = RewardAddOnSelectionViewController.instantiate() | ||
controller.configureWith(project: project, reward: reward, refTag: nil, context: .pledge) | ||
let (parent, _) = traitControllers(device: device, orientation: .portrait, child: controller) | ||
parent.view.frame.size.height = 600 | ||
|
||
self.scheduler.advance() | ||
self.scheduler.advance(by: .seconds(1)) | ||
|
||
FBSnapshotVerifyView(parent.view, identifier: "lang_\(language)_device_\(device)") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.