|
|
@ -23,6 +23,8 @@ import androidx.compose.material3.SnackbarHostState
|
|
|
|
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
|
|
|
|
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
|
|
|
|
import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
|
|
|
import androidx.compose.material3.windowsizeclass.WindowSizeClass
|
|
|
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
|
|
import androidx.compose.runtime.rememberCoroutineScope
|
|
|
|
|
|
|
|
import androidx.compose.ui.test.DeviceConfigurationOverride
|
|
|
|
|
|
|
|
import androidx.compose.ui.test.ForcedSize
|
|
|
|
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
|
|
|
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
|
|
|
import androidx.compose.ui.test.onRoot
|
|
|
|
import androidx.compose.ui.test.onRoot
|
|
|
|
import androidx.compose.ui.unit.Dp
|
|
|
|
import androidx.compose.ui.unit.Dp
|
|
|
@ -33,7 +35,6 @@ import androidx.work.Configuration
|
|
|
|
import androidx.work.testing.SynchronousExecutor
|
|
|
|
import androidx.work.testing.SynchronousExecutor
|
|
|
|
import androidx.work.testing.WorkManagerTestInitHelper
|
|
|
|
import androidx.work.testing.WorkManagerTestInitHelper
|
|
|
|
import com.github.takahirom.roborazzi.captureRoboImage
|
|
|
|
import com.github.takahirom.roborazzi.captureRoboImage
|
|
|
|
import com.google.accompanist.testharness.TestHarness
|
|
|
|
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.repository.TopicsRepository
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.repository.TopicsRepository
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.repository.UserNewsResourceRepository
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.repository.UserNewsResourceRepository
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.test.repository.FakeUserDataRepository
|
|
|
|
import com.google.samples.apps.nowinandroid.core.data.test.repository.FakeUserDataRepository
|
|
|
@ -208,7 +209,9 @@ class SnackbarScreenshotTests {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
composeTestRule.setContent {
|
|
|
|
scope = rememberCoroutineScope()
|
|
|
|
scope = rememberCoroutineScope()
|
|
|
|
|
|
|
|
|
|
|
|
TestHarness(size = DpSize(width, height)) {
|
|
|
|
DeviceConfigurationOverride(
|
|
|
|
|
|
|
|
DeviceConfigurationOverride.ForcedSize(DpSize(width, height)),
|
|
|
|
|
|
|
|
) {
|
|
|
|
BoxWithConstraints {
|
|
|
|
BoxWithConstraints {
|
|
|
|
val appState = rememberNiaAppState(
|
|
|
|
val appState = rememberNiaAppState(
|
|
|
|
windowSizeClass = WindowSizeClass.calculateFromSize(
|
|
|
|
windowSizeClass = WindowSizeClass.calculateFromSize(
|
|
|
|