Skip to content

Commit

Permalink
MBL-1341: Missing delivery date (#2023)
Browse files Browse the repository at this point in the history
  • Loading branch information
leighdouglas authored Apr 22, 2024
1 parent 8b08547 commit c4825d1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class RewardsSelectionViewModel(environment: Environment) : ViewModel() {
viewModelScope.launch {
val pledgeDataAndReason = pledgeDataAndPledgeReason(currentProjectData, reward)
newUserReward = pledgeDataAndReason.first.reward()

emitCurrentState()
analytics.trackSelectRewardCTA(pledgeDataAndReason.first)

when (pledgeDataAndReason.second) {
Expand Down Expand Up @@ -182,6 +182,7 @@ class RewardsSelectionViewModel(environment: Environment) : ViewModel() {
initialRewardIndex = indexOfBackedReward,
project = currentProjectData,
showAlertDialog = showAlertDialog,
selectedReward = newUserReward
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {

viewModel.onUserRewardSelection(testRewards[2])

assert(uiState.size == 2)
assert(uiState.size == 3)
assert(flowState.size == 1)
assertEquals(
flowState.last(),
Expand Down Expand Up @@ -141,7 +141,7 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {

viewModel.onUserRewardSelection(testRewards[2])

assert(uiState.size == 2)
assert(uiState.size == 3)
assert(flowState.size == 1)
assertEquals(
flowState.last(),
Expand Down Expand Up @@ -191,7 +191,7 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {

viewModel.onUserRewardSelection(testRewards[2])

assert(uiState.size == 2)
assert(uiState.size == 3)
assert(flowState.size == 1)
assertEquals(
flowState.last(),
Expand Down Expand Up @@ -241,7 +241,7 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {

viewModel.onUserRewardSelection(testRewards[2])

assert(uiState.size == 2)
assert(uiState.size == 3)
assert(flowState.size == 1)
assertEquals(
flowState.last(),
Expand Down Expand Up @@ -299,7 +299,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = true
showAlertDialog = true,
selectedReward = testRewards[2]
)
)

Expand Down Expand Up @@ -346,7 +347,7 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {

viewModel.onUserRewardSelection(testRewards[2])

assert(uiState.size == 2)
assert(uiState.size == 3)
assert(flowState.size == 1)
assertEquals(
flowState.last(),
Expand Down Expand Up @@ -407,7 +408,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = true
showAlertDialog = true,
selectedReward = testRewards[2]
)
)

Expand Down Expand Up @@ -464,7 +466,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = true
showAlertDialog = true,
selectedReward = testRewards[2]
)
)

Expand Down Expand Up @@ -530,7 +533,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = true
showAlertDialog = true,
selectedReward = testRewards[2]
)
)

Expand Down Expand Up @@ -596,7 +600,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = true
showAlertDialog = true,
selectedReward = testRewards[2]
)
)

Expand All @@ -610,7 +615,8 @@ class RewardsSelectionViewModelTest : KSRobolectricTestCase() {
rewardList = testRewards,
initialRewardIndex = 3,
project = testProjectData,
showAlertDialog = false
showAlertDialog = false,
selectedReward = testRewards[2]
)
)

Expand Down

0 comments on commit c4825d1

Please sign in to comment.