Fix tests.
This commit is contained in:
parent
18e95578ce
commit
9d8f670323
2 changed files with 17 additions and 18 deletions
|
|
@ -52,6 +52,21 @@ class DeveloperSettingsViewTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Config(qualifiers = "h1500dp")
|
||||||
|
@Test
|
||||||
|
fun `clicking on push history notification invokes the expected callback`() {
|
||||||
|
val eventsRecorder = EventsRecorder<DeveloperSettingsEvents>(expectEvents = false)
|
||||||
|
ensureCalledOnce {
|
||||||
|
rule.setDeveloperSettingsView(
|
||||||
|
state = aDeveloperSettingsState(
|
||||||
|
eventSink = eventsRecorder
|
||||||
|
),
|
||||||
|
onPushHistoryClick = it
|
||||||
|
)
|
||||||
|
rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Config(qualifiers = "h1500dp")
|
@Config(qualifiers = "h1500dp")
|
||||||
@Test
|
@Test
|
||||||
fun `clicking on element call url open the dialogs and submit emits the expected event`() {
|
fun `clicking on element call url open the dialogs and submit emits the expected event`() {
|
||||||
|
|
@ -114,12 +129,14 @@ class DeveloperSettingsViewTest {
|
||||||
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setDeveloperSettingsView(
|
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setDeveloperSettingsView(
|
||||||
state: DeveloperSettingsState,
|
state: DeveloperSettingsState,
|
||||||
onOpenShowkase: () -> Unit = EnsureNeverCalled(),
|
onOpenShowkase: () -> Unit = EnsureNeverCalled(),
|
||||||
|
onPushHistoryClick: () -> Unit = EnsureNeverCalled(),
|
||||||
onBackClick: () -> Unit = EnsureNeverCalled()
|
onBackClick: () -> Unit = EnsureNeverCalled()
|
||||||
) {
|
) {
|
||||||
setContent {
|
setContent {
|
||||||
DeveloperSettingsView(
|
DeveloperSettingsView(
|
||||||
state = state,
|
state = state,
|
||||||
onOpenShowkase = onOpenShowkase,
|
onOpenShowkase = onOpenShowkase,
|
||||||
|
onPushHistoryClick = onPushHistoryClick,
|
||||||
onBackClick = onBackClick,
|
onBackClick = onBackClick,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,22 +66,6 @@ class NotificationSettingsViewTest {
|
||||||
eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled)
|
eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Config(qualifiers = "h1024dp")
|
|
||||||
@Test
|
|
||||||
fun `clicking on push history notification invokes the expected callback`() {
|
|
||||||
val eventsRecorder = EventsRecorder<NotificationSettingsEvents>()
|
|
||||||
ensureCalledOnce {
|
|
||||||
rule.setNotificationSettingsView(
|
|
||||||
state = aValidNotificationSettingsState(
|
|
||||||
eventSink = eventsRecorder
|
|
||||||
),
|
|
||||||
onPushHistoryClick = it
|
|
||||||
)
|
|
||||||
rule.clickOn(R.string.troubleshoot_notifications_entry_point_push_history_title)
|
|
||||||
}
|
|
||||||
eventsRecorder.assertSingle(NotificationSettingsEvents.RefreshSystemNotificationsEnabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Config(qualifiers = "h1024dp")
|
@Config(qualifiers = "h1024dp")
|
||||||
@Test
|
@Test
|
||||||
fun `clicking on group chats invokes the expected callback`() {
|
fun `clicking on group chats invokes the expected callback`() {
|
||||||
|
|
@ -300,7 +284,6 @@ private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setNotif
|
||||||
state: NotificationSettingsState,
|
state: NotificationSettingsState,
|
||||||
onOpenEditDefault: (isOneToOne: Boolean) -> Unit = EnsureNeverCalledWithParam(),
|
onOpenEditDefault: (isOneToOne: Boolean) -> Unit = EnsureNeverCalledWithParam(),
|
||||||
onTroubleshootNotificationsClick: () -> Unit = EnsureNeverCalled(),
|
onTroubleshootNotificationsClick: () -> Unit = EnsureNeverCalled(),
|
||||||
onPushHistoryClick: () -> Unit = EnsureNeverCalled(),
|
|
||||||
onBackClick: () -> Unit = EnsureNeverCalled(),
|
onBackClick: () -> Unit = EnsureNeverCalled(),
|
||||||
) {
|
) {
|
||||||
setContent {
|
setContent {
|
||||||
|
|
@ -308,7 +291,6 @@ private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setNotif
|
||||||
state = state,
|
state = state,
|
||||||
onOpenEditDefault = onOpenEditDefault,
|
onOpenEditDefault = onOpenEditDefault,
|
||||||
onTroubleshootNotificationsClick = onTroubleshootNotificationsClick,
|
onTroubleshootNotificationsClick = onTroubleshootNotificationsClick,
|
||||||
onPushHistoryClick = onPushHistoryClick,
|
|
||||||
onBackClick = onBackClick,
|
onBackClick = onBackClick,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue