Skip to content

Commit

Permalink
tests: Utilize NotificationManager for another test
Browse files Browse the repository at this point in the history
  • Loading branch information
devinbileck committed Jan 10, 2025
1 parent bc6a096 commit 13cb0fb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/src/androidTest/java/bisq/android/tests/NotificationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,17 @@ class NotificationTest {
val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.openNotification()
device.wait(Until.hasObject(By.text("Bisq")), WAIT_CONDITION_TIMEOUT_MS)
val title: UiObject2 = device.getObject(By.text(bisqNotification.title!!))
val text: UiObject2 = device.getObject(By.text(bisqNotification.message!!))
assertThat(title.text).isEqualTo(bisqNotification.title)
assertThat(text.text).isEqualTo(bisqNotification.message)
val manager = applicationContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
assertThat(
manager.activeNotifications.find {
it.notification.extras.getString(Notification.EXTRA_TITLE).equals(bisqNotification.title)
}
).isNotNull
assertThat(
manager.activeNotifications.find {
it.notification.extras.getString(Notification.EXTRA_TEXT).equals(bisqNotification.message)
}
).isNotNull
}

@Test
Expand Down

0 comments on commit 13cb0fb

Please sign in to comment.