mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 16:27:06 +05:30
paparazzi-tests: switch MonthHeaderTest to TestParameterInjector
This commit is contained in:
parent
b282e47213
commit
5e3bc96493
7 changed files with 19 additions and 12 deletions
|
@ -2,27 +2,22 @@ package dev.msfjarvis.claw.android.tests
|
|||
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import app.cash.paparazzi.Paparazzi
|
||||
import dev.msfjarvis.claw.common.theme.DarkThemeColors
|
||||
import dev.msfjarvis.claw.common.theme.LightThemeColors
|
||||
import com.google.testing.junit.testparameterinjector.TestParameter
|
||||
import com.google.testing.junit.testparameterinjector.TestParameterInjector
|
||||
import dev.msfjarvis.claw.common.ui.decorations.MonthHeader
|
||||
import kotlinx.datetime.Month
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@RunWith(TestParameterInjector::class)
|
||||
class MonthHeaderTest {
|
||||
@get:Rule val paparazzi = Paparazzi()
|
||||
|
||||
@Test
|
||||
fun light_mode() {
|
||||
paparazzi.snapshot {
|
||||
MaterialTheme(colorScheme = LightThemeColors) { MonthHeader(Month.APRIL) }
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun dark_mode() {
|
||||
paparazzi.snapshot {
|
||||
MaterialTheme(colorScheme = DarkThemeColors) { MonthHeader(Month.JANUARY) }
|
||||
fun verify(@TestParameter theme: Theme) {
|
||||
paparazzi.snapshot(name = theme.name) {
|
||||
MaterialTheme(colorScheme = theme.colors) { MonthHeader(Month.APRIL) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package dev.msfjarvis.claw.android.tests
|
||||
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import dev.msfjarvis.claw.common.theme.DarkThemeColors
|
||||
import dev.msfjarvis.claw.common.theme.LightThemeColors
|
||||
|
||||
enum class Theme(val colors: ColorScheme) {
|
||||
Light(LightThemeColors),
|
||||
Dark(DarkThemeColors),
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 8.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Loading…
Add table
Add a link
Reference in a new issue