Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7451332 authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Clear invocations earlier in dnd test

This is necessary because dndMode (being a StateFlow), has an extra
"default value" emission at the beginning. Removing
clearInvocations() in the test steps makes it clearer that there
are no unwanted emissions when activating/deactivating DND at any
point afterwards.

Bug: 380908293
Test: ClockEventControllerTest
Flag: TEST_ONLY
Change-Id: I0b630b0bcbba00a8211134eb0ccc070af3af33ca
parent e5f1dc59
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -529,6 +529,8 @@ class ClockEventControllerTest : SysuiTestCase() {
    fun listenForDnd_onDndChange_updatesClockZenMode() =
        testScope.runTest {
            underTest.listenForDnd(testScope.backgroundScope)
            runCurrent()
            clearInvocations(events)

            zenModeRepository.activateMode(dndModeId)
            runCurrent()
@@ -537,7 +539,6 @@ class ClockEventControllerTest : SysuiTestCase() {
                .onZenDataChanged(
                    eq(ZenData(ZenMode.IMPORTANT_INTERRUPTIONS, R.string::dnd_is_on.name))
                )
            clearInvocations(events)

            zenModeRepository.deactivateMode(dndModeId)
            runCurrent()