Revert RenderingMode to NORMAL in ScreenshotTest (#475)
* Revert `RenderingMode` to `NORMAL` in `ScreenshotTest` * Remove no longer needed code
This commit is contained in:
committed by
GitHub
parent
59b7507fed
commit
5cafd68ebe
@@ -25,10 +25,5 @@ class ComponentTestPreview(
|
||||
@Composable
|
||||
override fun Content() = showkaseBrowserComponent.component()
|
||||
|
||||
override val needsScroll: Boolean = showkaseBrowserComponent.heightDp != null
|
||||
|
||||
override val customHeightDp: Int? = showkaseBrowserComponent.heightDp.takeIf { it != null }
|
||||
|
||||
|
||||
override fun toString(): String = showkaseBrowserComponent.componentKey
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@ import androidx.activity.OnBackPressedDispatcherOwner
|
||||
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.sizeIn
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -34,14 +32,12 @@ import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.platform.LocalLifecycleOwner
|
||||
import androidx.compose.ui.unit.Density
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import app.cash.paparazzi.Paparazzi
|
||||
import com.airbnb.android.showkase.models.Showkase
|
||||
import com.android.ide.common.rendering.api.SessionParams
|
||||
import com.google.testing.junit.testparameterinjector.TestParameter
|
||||
import com.google.testing.junit.testparameterinjector.TestParameterInjector
|
||||
import io.element.android.libraries.designsystem.modifiers.applyIf
|
||||
import io.element.android.libraries.designsystem.theme.ElementTheme
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
@@ -74,7 +70,7 @@ class ScreenshotTest {
|
||||
@get:Rule
|
||||
val paparazzi = Paparazzi(
|
||||
maxPercentDifference = 0.01,
|
||||
renderingMode = SessionParams.RenderingMode.SHRINK,
|
||||
renderingMode = SessionParams.RenderingMode.NORMAL,
|
||||
)
|
||||
|
||||
@Test
|
||||
@@ -84,14 +80,10 @@ class ScreenshotTest {
|
||||
@TestParameter(value = ["1.0"/*, "1.5"*/]) fontScale: Float,
|
||||
@TestParameter(value = ["en" /*"fr", "de", "ru"*/]) localeStr: String,
|
||||
) {
|
||||
val needsScrolling = componentTestPreview.needsScroll
|
||||
val screenHeight = componentTestPreview.customHeightDp.takeIf { it != null }
|
||||
paparazzi.unsafeUpdateConfig(
|
||||
deviceConfig = baseDeviceConfig.deviceConfig.copy(
|
||||
softButtons = false,
|
||||
screenHeight = screenHeight ?: baseDeviceConfig.deviceConfig.screenHeight
|
||||
softButtons = false
|
||||
),
|
||||
renderingMode = if (needsScrolling) SessionParams.RenderingMode.V_SCROLL else SessionParams.RenderingMode.SHRINK
|
||||
)
|
||||
paparazzi.snapshot {
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
@@ -114,10 +106,6 @@ class ScreenshotTest {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.sizeIn(minWidth = 1.dp, minHeight = 1.dp)
|
||||
.applyIf(needsScrolling, ifTrue = {
|
||||
heightIn(max = 1000.dp)
|
||||
})
|
||||
) {
|
||||
componentTestPreview.Content()
|
||||
}
|
||||
|
||||
@@ -21,8 +21,4 @@ import androidx.compose.runtime.Composable
|
||||
interface TestPreview {
|
||||
@Composable
|
||||
fun Content()
|
||||
|
||||
val needsScroll: Boolean get() = false
|
||||
|
||||
val customHeightDp: Int? get() = null
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user