Skip to content

Commit

Permalink
Fix broken "CreateOneTimePlannedPayment_fromFAB" test
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliyan Germanov committed Nov 24, 2021
1 parent 1d196af commit 4b15f25
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.ui.test.performClick
import com.ivy.wallet.base.timeNowUTC
import com.ivy.wallet.compose.IvyComposeTest
import com.ivy.wallet.compose.helpers.*
import com.ivy.wallet.compose.printTree
import com.ivy.wallet.model.IntervalType
import com.ivy.wallet.model.TransactionType
import dagger.hilt.android.testing.HiltAndroidTest
Expand Down Expand Up @@ -66,11 +65,19 @@ class PlannedPaymentsTest : IvyComposeTest() {
}

@Test
fun CreateOneTimePlanendPayment_fromFAB() {
fun CreateOneTimePlannedPayment_fromFAB() {
onboardingFlow.quickOnboarding()

//Add one transaction so the "Adjust Balance" prompt can disappear and the screen to be scrollable
transactionFlow.addIncome(
amount = 100.0,
title = "Adjust Balance"
)

homeTab.dismissPrompt() //Dismiss "Add Planned Payment" prompt

mainBottomBar.clickAddFAB()
mainBottomBar.clickAddPlannedPayment()

editPlannedScreen.addPlannedPayment(
type = TransactionType.EXPENSE,
oneTime = true,
Expand All @@ -83,7 +90,7 @@ class PlannedPaymentsTest : IvyComposeTest() {
)

homeTab.assertBalance(
amount = "0",
amount = "100",
amountDecimal = ".00"
)

Expand All @@ -98,11 +105,9 @@ class PlannedPaymentsTest : IvyComposeTest() {
composeTestRule.waitForIdle()

homeTab.assertBalance(
amount = "-530",
amount = "-430", //-530.25 + 100.00 = -430.25
amountDecimal = ".25"
)

composeTestRule.printTree(useUnmergedTree = true)
}

@Test
Expand Down

0 comments on commit 4b15f25

Please sign in to comment.