Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NT-1140] Reward Add-Ons #1242

Merged
merged 30 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
05d45d1
[NT-1295] Add UITableView and data source to ManagePledgeViewControll…
justinswart Jun 12, 2020
6020fc7
Merge branch 'master' into NT-1140-add-ons-manage-context
justinswart Jun 13, 2020
a6325ec
Merge branch 'master' into NT-1140-add-ons-manage-context
justinswart Jun 16, 2020
9cb0fcc
[NT-1340] Expandable Rewards Pledge View Header (#1226)
justinswart Jun 17, 2020
202e4d8
Merge branch 'master' into NT-1140-add-ons-manage-context
justinswart Jun 17, 2020
153a524
Replace PledgeDescriptionView with project title label (#1229)
justinswart Jun 18, 2020
dbdabde
[NT-1341 ] Rewards header expand/collapse animation (#1230)
justinswart Jun 19, 2020
04fe7cb
[NT-1329, NT-1330] Bonus Support UI (#1233)
justinswart Jun 23, 2020
fe0dab8
Fix padding on pledge disclaimer view (#1235)
justinswart Jun 24, 2020
edfce85
Merge branch 'master' into NT-1140-add-ons-manage-context
justinswart Jun 24, 2020
c680102
Merge branch 'master' into NT-1140-add-ons-manage-context
justinswart Jun 27, 2020
4150311
[NT-1330] Fix bonus support behaviour and validation (#1236)
justinswart Jun 27, 2020
c4bfdbc
Merge branch 'master' into NT-1140-feature-add-ons-phase-1
justinswart Jun 29, 2020
e711088
Fix info displayed on manage pledge view (#1241)
justinswart Jun 30, 2020
49662f5
[NT-1405] Use bonus support as total for No Reward (#1240)
justinswart Jun 30, 2020
c9c9f36
Merge branch 'master' into NT-1140-feature-add-ons-phase-1
justinswart Aug 6, 2020
38ff748
Merge branch 'master' into NT-1140-feature-add-ons-phase-1
justinswart Aug 20, 2020
e709093
[NT-1140] Add-Ons Phase 2 (#1245)
justinswart Aug 21, 2020
cece550
Update max pledge string (#1266)
justinswart Aug 27, 2020
2ae6d5d
Remove rounding on bonus support tracking property (#1267)
justinswart Aug 27, 2020
b313450
[NT-1372, NT-1459] Update Backing with Add-ons (#1268)
justinswart Aug 27, 2020
24f8042
Refresh shipping locations on error (#1270)
justinswart Aug 27, 2020
f4c1e70
Fix tests (#1271)
justinswart Aug 28, 2020
6aca60d
Prevent race condish (#1272)
justinswart Aug 28, 2020
224949f
[NT-1481] Remove Amount Shipping Locations List (#1273)
justinswart Aug 28, 2020
3eddc7d
Tracking for add-ons (#1276)
justinswart Sep 1, 2020
fb040d4
Add haptics to add-on selection card (#1277)
justinswart Sep 1, 2020
fa244ce
Update translations (#1275)
justinswart Sep 1, 2020
b29a051
[NT-1416] Navigation bugfix (#1274)
justinswart Sep 1, 2020
13dd083
Update alert copy (#1278)
justinswart Sep 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[NT-1405] Use bonus support as total for No Reward (#1240)
* Use bonus amount as total for no reward

* Fix snapshot test
  • Loading branch information
justinswart authored Jun 30, 2020
commit 49662f5a64fee88e4e703fc671c92f88a60d5c13
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,11 @@ final class ManagePledgeViewControllerTests: TestCase {
|> \.backing.shippingAmount .~ nil

envelope = envelope
|> \.backing.bonusAmount .~ Money(amount: 10.0, currency: .gbp, symbol: "Β£")
|> \.backing.pledgedOn .~ TimeInterval(1_475_361_315)
|> \.backing.amount .~ Money(amount: 10.0, currency: .gbp, symbol: "Β£")
|> \.backing.backer.uid .~ user.id
|> \.backing.backer.name .~ "Blob"
|> \.backing.reward .~ (
ManagePledgeViewBackingEnvelope.Backing.Reward.template
|> \.amount .~ Money(amount: 10.0, currency: .gbp, symbol: "Β£")
)

let mockService = MockService(
fetchManagePledgeViewBackingResult: .success(envelope),
Expand Down
2 changes: 1 addition & 1 deletion Library/ViewModels/PledgeAmountSummaryViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class PledgeAmountSummaryViewModel: PledgeAmountSummaryViewModelType,
.map {
(
$0.projectCountry,
$0.rewardMinimum,
$0.isNoReward ? ($0.bonusAmount ?? 0) : $0.rewardMinimum,
$0.omitUSCurrencyCode
)
}
Expand Down
24 changes: 21 additions & 3 deletions Library/ViewModels/PledgeAmountSummaryViewModelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ final class PledgeAmountSummaryViewModelTests: TestCase {

func testBonusAmountStackViewIsHidden_isTrue_WhenIsNoReward() {
let data = PledgeAmountSummaryViewData(
bonusAmount: 0,
bonusAmount: 1,
isNoReward: true,
locationName: nil,
omitUSCurrencyCode: true,
projectCountry: Project.Country.us,
pledgedOn: 1_568_666_243.0,
rewardMinimum: 30,
shippingAmount: 7.0
rewardMinimum: 0,
shippingAmount: 0
)

self.vm.inputs.configureWith(data)
Expand All @@ -144,4 +144,22 @@ final class PledgeAmountSummaryViewModelTests: TestCase {

self.shippingLocationStackViewIsHidden.assertValue(true)
}

func testPledgeAmountText_NoReward() {
let data = PledgeAmountSummaryViewData(
bonusAmount: 2,
isNoReward: true,
locationName: nil,
omitUSCurrencyCode: true,
projectCountry: Project.Country.us,
pledgedOn: 1_568_666_243.0,
rewardMinimum: 0,
shippingAmount: 0
)

self.vm.inputs.configureWith(data)
self.vm.inputs.viewDidLoad()

self.pledgeAmountText.assertValues(["$2.00"], "Bonus amount is used as pledge total for No Reward type")
}
}