-
Notifications
You must be signed in to change notification settings - Fork 13
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
5 changed files
with
75 additions
and
0 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
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
[versions] | ||
composeOClock = "0.1.0-SNAPSHOT" | ||
roborazzi = "1.10.1" | ||
|
||
[libraries] | ||
compose-oclock-core = { group = "org.splitties.compose.oclock", name = "core", version.ref = "composeOClock" } | ||
compose-oclock-watchface-renderer = { group = "org.splitties.compose.oclock", name = "watchface-renderer", version.ref = "composeOClock" } | ||
roborazzi = { group = "io.github.takahirom.roborazzi", name = "roborazzi", version.ref = "roborazzi" } | ||
roborazzi-compose = { group = "io.github.takahirom.roborazzi", name = "roborazzi-compose", version.ref = "roborazzi" } | ||
roborazzi-rule = { group = "io.github.takahirom.roborazzi", name = "roborazzi-junit-rule", version.ref = "roborazzi" } |
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
42 changes: 42 additions & 0 deletions
42
.../src/test/kotlin/org/splitties/compose/oclock/sample/watchfaces/hansie/HansieClockTest.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,42 @@ | ||
package org.splitties.compose.oclock.sample.watchfaces.hansie | ||
|
||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onRoot | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import com.github.takahirom.roborazzi.captureRoboImage | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.annotation.Config | ||
import org.robolectric.annotation.GraphicsMode | ||
import org.splitties.compose.oclock.OClockRootCanvas | ||
|
||
@Config( | ||
sdk = [33], | ||
qualifiers = "w227dp-h227dp-small-notlong-round-watch-xhdpi-keyshidden-nonav", | ||
) | ||
@GraphicsMode(GraphicsMode.Mode.NATIVE) | ||
@RunWith(AndroidJUnit4::class) | ||
class HansieClockTest { | ||
@get:Rule | ||
val composeRule = createComposeRule() | ||
|
||
@Test | ||
fun roborazziTest() { | ||
composeRule.setContent { | ||
OClockRootCanvas( | ||
modifier = Modifier.fillMaxSize(), | ||
isAmbientFlow = MutableStateFlow(false) | ||
) { | ||
HansieClock() | ||
} | ||
} | ||
|
||
composeRule | ||
.onRoot() | ||
.captureRoboImage() | ||
} | ||
} |
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