From ca457b1116dcc3d8264d7d14c54e8cb2b5df6596 Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Thu, 9 Dec 2021 15:03:01 -0500 Subject: [PATCH] [#118] Fix backup verification UI --- .../z/ecc/ui/screen/backup/view/BackupViewTest.kt | 14 ++++++++++++++ .../cash/z/ecc/ui/screen/backup/view/BackupView.kt | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ui-lib/src/androidTest/java/cash/z/ecc/ui/screen/backup/view/BackupViewTest.kt b/ui-lib/src/androidTest/java/cash/z/ecc/ui/screen/backup/view/BackupViewTest.kt index 8d48cf7d..4e70d457 100644 --- a/ui-lib/src/androidTest/java/cash/z/ecc/ui/screen/backup/view/BackupViewTest.kt +++ b/ui-lib/src/androidTest/java/cash/z/ecc/ui/screen/backup/view/BackupViewTest.kt @@ -111,6 +111,20 @@ class BackupViewTest { composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_4_button_retry))).performClick() assertEquals(BackupStage.Seed, testSetup.getStage()) + + composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_3_button_finished))).performClick() + + assertEquals(BackupStage.Test, testSetup.getStage()) + + // These verify that the test itself is re-displayed + + composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_4_header_verify))).also { + it.assertExists() + } + + composeTestRule.onNode(hasText(getStringResource(R.string.new_wallet_4_header_ouch))).also { + it.assertDoesNotExist() + } } @Test diff --git a/ui-lib/src/main/java/cash/z/ecc/ui/screen/backup/view/BackupView.kt b/ui-lib/src/main/java/cash/z/ecc/ui/screen/backup/view/BackupView.kt index 64ebe3bd..7ef505e5 100644 --- a/ui-lib/src/main/java/cash/z/ecc/ui/screen/backup/view/BackupView.kt +++ b/ui-lib/src/main/java/cash/z/ecc/ui/screen/backup/view/BackupView.kt @@ -155,7 +155,11 @@ private fun Test( onNext() } currentSelectedTestChoice.none { null == it.value } -> { - TestFailure(onBack) + TestFailure { + // Clear the user's prior test inputs for the retest + selectedTestChoices.set(emptyMap()) + onBack() + } } } }