Last active
April 29, 2022 13:24
-
-
Save igorescodro/5df388deb0a48c988baad0e64c5ab3e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun test_myNotification() { | |
// Send the notification | |
val id = 13 | |
val name = "Testing my notification" | |
myNotification.send(id = id, name = name) | |
val manager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager | |
// Wait until the active notification list has a new one | |
composeTestRule.waitUntil { manager.activeNotifications.isNotEmpty() } | |
// Validate the notification info | |
with(manager.activeNotifications.first()) { | |
assertEquals(id, this.id) | |
assertEquals(name, this.notification.extras[Notification.EXTRA_TEXT]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment