Skip to content

Commit

Permalink
PAY-2077: Updating amount using input text (#1712)
Browse files Browse the repository at this point in the history
Co-authored-by: Hadia <hadiamohamed.iti@gmail.com>
  • Loading branch information
Arkariang and hadia committed Dec 1, 2022
1 parent 42e0a83 commit 5085ced
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Expand Up @@ -1670,7 +1670,7 @@ interface PledgeFragmentLegacyViewModel {

if (pReason == PledgeReason.PLEDGE) updated = true
else if (pReason == PledgeReason.UPDATE_PLEDGE) {
updated = (bHasChanged && aUpdated) || shippingUpdated
updated = (bHasChanged || aUpdated) || shippingUpdated
}

return updated
Expand Down
Expand Up @@ -1731,7 +1731,7 @@ interface PledgeFragmentViewModel {

if (pReason == PledgeReason.PLEDGE) updated = true
else if (pReason == PledgeReason.UPDATE_PLEDGE) {
updated = (bHasChanged && aUpdated) || shippingUpdated
updated = (bHasChanged || aUpdated) || shippingUpdated
}

return updated
Expand Down
Expand Up @@ -1947,7 +1947,7 @@ class PledgeFragmentLegacyViewModelTest : KSRobolectricTestCase() {
this.vm.inputs.increasePledgeButtonClicked()
this.vm.inputs.pledgeButtonClicked()

this.pledgeButtonIsEnabled.assertValues(false, false, true)
this.pledgeButtonIsEnabled.assertValues(false, true, false, true)
this.pledgeProgressIsGone.assertValues(false, true)
this.showUpdatePledgeError.assertValueCount(1)
}
Expand Down Expand Up @@ -2057,7 +2057,7 @@ class PledgeFragmentLegacyViewModelTest : KSRobolectricTestCase() {
this.vm.inputs.increasePledgeButtonClicked()
this.vm.inputs.pledgeButtonClicked()

this.pledgeButtonIsEnabled.assertValues(false, false)
this.pledgeButtonIsEnabled.assertValues(false, true, false)
this.pledgeProgressIsGone.assertValue(false)
}

Expand Down Expand Up @@ -3056,6 +3056,7 @@ class PledgeFragmentLegacyViewModelTest : KSRobolectricTestCase() {
)
.reward(reward)
.rewardId(reward.id())
.amount(reward.convertedMinimum())
.build()
val backedProject = ProjectFactory.backedProject()
.toBuilder()
Expand Down
Expand Up @@ -2018,7 +2018,7 @@ class PledgeFragmentViewModelTest : KSRobolectricTestCase() {
this.vm.inputs.increasePledgeButtonClicked()
this.vm.inputs.pledgeButtonClicked()

this.pledgeButtonIsEnabled.assertValues(false, false, true)
this.pledgeButtonIsEnabled.assertValues(false, true, false, true)
this.pledgeProgressIsGone.assertValues(false, true)
this.showUpdatePledgeError.assertValueCount(1)
}
Expand Down Expand Up @@ -2128,7 +2128,7 @@ class PledgeFragmentViewModelTest : KSRobolectricTestCase() {
this.vm.inputs.increasePledgeButtonClicked()
this.vm.inputs.pledgeButtonClicked()

this.pledgeButtonIsEnabled.assertValues(false, false)
this.pledgeButtonIsEnabled.assertValues(false, true, false)
this.pledgeProgressIsGone.assertValue(false)
}

Expand Down Expand Up @@ -3167,6 +3167,7 @@ class PledgeFragmentViewModelTest : KSRobolectricTestCase() {
)
.reward(reward)
.rewardId(reward.id())
.amount(reward.convertedMinimum())
.build()
val backedProject = ProjectFactory.backedProject()
.toBuilder()
Expand Down

0 comments on commit 5085ced

Please sign in to comment.