Skip to content

Commit

Permalink
Added ComposeScreenNoKeyAvailableFlowTest.testAddEmailToExistingSingl…
Browse files Browse the repository at this point in the history
…eKeyPassphraseInDatabase().| #597
  • Loading branch information
DenBond7 committed Apr 4, 2024
1 parent a9cb84c commit e34f85c
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,42 @@ class ComposeScreenNoKeyAvailableFlowTest : BaseComposeScreenTest() {
.check(matches(not(hasTextColor(R.color.gray))))
}

@Test
fun testAddEmailToExistingSingleKeyPassphraseInDatabase() {
activeActivityRule?.launch(intent)
registerAllIdlingResources()
fillInAllFields(
to = setOf(
requireNotNull(TestConstants.RECIPIENT_WITH_PUBLIC_KEY_ON_ATTESTER.asInternetAddress())
)
)

//check that editTextFrom has gray text color. It means a sender doesn't have a private key
onView(withId(R.id.editTextFrom))
.check(matches(isDisplayed()))
.check(matches(hasTextColor(R.color.gray)))

onView(withId(R.id.menuActionSend))
.check(matches(isDisplayed()))
.perform(click())

isDialogWithTextDisplayed(
decorView,
getResString(R.string.no_key_available, addAccountToDatabaseRule.account.email)
)

onView(withText(R.string.add_email_to_existing_key))
.check(matches(isDisplayed()))
.perform(click())

Thread.sleep(2000)

//check that editTextFrom doesn't have gray text color. It means a sender has a private key.
onView(withId(R.id.editTextFrom))
.check(matches(isDisplayed()))
.check(matches(not(hasTextColor(R.color.gray))))
}

companion object {
@get:ClassRule
@JvmStatic
Expand Down

0 comments on commit e34f85c

Please sign in to comment.