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

Commit f7caccc9 authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[Dual Shade] Fix GridLayoutTypeInteractorTest for Dual Shade on.

This ensures these unit tests do not fail when Dual Shade is the default
shade experience in scene container.

Bug: 376411622
Test: Updated unit tests.
Flag: com.android.systemui.scene_container
Change-Id: I4e38ff096f502d7ac4513dd8324e9d93c7fdc70e
parent 17e0936f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.collectLastValue
import com.android.systemui.kosmos.runTest
import com.android.systemui.kosmos.useUnconfinedTestDispatcher
import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
import com.android.systemui.qs.panels.shared.model.PaginatedGridLayoutType
import com.android.systemui.shade.domain.interactor.enableDualShade
@@ -37,7 +38,8 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
@EnableSceneContainer
class GridLayoutTypeInteractorTest : SysuiTestCase() {
    val kosmos = testKosmos()

    val kosmos = testKosmos().useUnconfinedTestDispatcher()

    val Kosmos.underTest by Kosmos.Fixture { kosmos.gridLayoutTypeInteractor }

@@ -46,10 +48,10 @@ class GridLayoutTypeInteractorTest : SysuiTestCase() {
        kosmos.runTest {
            val type by collectLastValue(underTest.layout)

            kosmos.enableSingleShade()
            enableSingleShade()
            assertThat(type).isEqualTo(PaginatedGridLayoutType)

            kosmos.enableSplitShade()
            enableSplitShade()
            assertThat(type).isEqualTo(PaginatedGridLayoutType)
        }

@@ -58,10 +60,10 @@ class GridLayoutTypeInteractorTest : SysuiTestCase() {
        kosmos.runTest {
            val type by collectLastValue(underTest.layout)

            kosmos.enableDualShade(wideLayout = false)
            enableDualShade(wideLayout = false)
            assertThat(type).isEqualTo(InfiniteGridLayoutType)

            kosmos.enableDualShade(wideLayout = true)
            enableDualShade(wideLayout = true)
            assertThat(type).isEqualTo(InfiniteGridLayoutType)
        }
}