-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
88 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...c/test/kotlin/org/splitties/compose/oclock/sample/watchfaces/DeviceClockScreenshotTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.splitties.compose.oclock.sample.watchfaces | ||
|
||
import androidx.compose.runtime.Composable | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.ParameterizedRobolectricTestRunner | ||
import org.splitties.compose.oclock.sample.watchfaces.WearDevice.Companion.GooglePixelWatch | ||
import org.splitties.compose.oclock.sample.watchfaces.WearDevice.Companion.MobvoiTicWatchPro5 | ||
import org.splitties.compose.oclock.sample.watchfaces.WearDevice.Companion.SamsungGalaxyWatch5 | ||
|
||
@RunWith(ParameterizedRobolectricTestRunner::class) | ||
abstract class DeviceClockScreenshotTest(override val device: WearDevice): ClockScreenshotTest() { | ||
|
||
@Test | ||
fun interactive() = runTest { | ||
Clock() | ||
} | ||
|
||
@Test | ||
fun ambient() = runTest { | ||
Clock() | ||
} | ||
|
||
@Composable | ||
abstract fun Clock() | ||
|
||
companion object { | ||
@JvmStatic | ||
@ParameterizedRobolectricTestRunner.Parameters | ||
fun devices() = listOf( | ||
MobvoiTicWatchPro5, | ||
SamsungGalaxyWatch5, | ||
GooglePixelWatch, | ||
) | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
shared/src/test/kotlin/org/splitties/compose/oclock/sample/watchfaces/Devices.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.splitties.compose.oclock.sample.watchfaces | ||
|
||
data class WearDevice( | ||
val id: String, | ||
val modelName: String, | ||
val px: Int, | ||
val density: Float | ||
) { | ||
companion object { | ||
val MobvoiTicWatchPro5: WearDevice = WearDevice( | ||
id = "ticwatch_pro_5", | ||
modelName = "Mobvoi TicWatch Pro 5", | ||
px = 466, | ||
density = 2.0f, | ||
) | ||
|
||
val SamsungGalaxyWatch5: WearDevice = WearDevice( | ||
id = "galaxy_watch_5", | ||
modelName = "Samsung Galaxy Watch 5", | ||
px = 396, | ||
density = 2.0f, | ||
) | ||
|
||
val GooglePixelWatch: WearDevice = WearDevice( | ||
id = "pixelwatch", | ||
modelName = "Google Pixel Watch", | ||
px = 384, | ||
density = 2.0f, | ||
) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
shared/src/test/kotlin/org/splitties/compose/oclock/sample/watchfaces/KotlinFanClockTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.splitties.compose.oclock.sample.watchfaces | ||
|
||
import androidx.compose.runtime.Composable | ||
|
||
class KotlinFanClockTest(device: WearDevice) : DeviceClockScreenshotTest(device) { | ||
@Composable | ||
override fun Clock() { | ||
KotlinFanClock() | ||
} | ||
} |