mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
fix(ui): keep the ring veil count per test (#1739)
* ci: run unit tests in four forks * fix(ui): keep the ring veil count per test so tests do not share snapshot state * ci: keep two unit test forks, four were slower
This commit is contained in:
1 parent
92787dd0f0
commit
1e92d10fa5
2 files changed
+7
-1
No files matched your search
@@ -94,7 +94,12 @@ internal class FocusGlide(view: View?) {
|
|||||||
internal val LocalFocusGlide = staticCompositionLocalOf<FocusGlide?> { null }
|
internal val LocalFocusGlide = staticCompositionLocalOf<FocusGlide?> { null }
|
||||||
|
|
||||||
internal object RingVeil {
|
internal object RingVeil {
|
||||||
var count by mutableIntStateOf(0)
|
private var state = mutableIntStateOf(0)
|
||||||
|
var count: Int
|
||||||
|
get() = state.intValue
|
||||||
|
set(value) { state.intValue = value }
|
||||||
|
|
||||||
|
internal fun reset() { state = mutableIntStateOf(0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.robolectric.RuntimeEnvironment
|
|||||||
import org.robolectric.Shadows.shadowOf
|
import org.robolectric.Shadows.shadowOf
|
||||||
|
|
||||||
fun createRobolectricComposeRule() = createComposeRule().also {
|
fun createRobolectricComposeRule() = createComposeRule().also {
|
||||||
|
RingVeil.reset()
|
||||||
val context = RuntimeEnvironment.getApplication()
|
val context = RuntimeEnvironment.getApplication()
|
||||||
shadowOf(context.packageManager).addActivityIfNotPresent(
|
shadowOf(context.packageManager).addActivityIfNotPresent(
|
||||||
ComponentName(context, ComponentActivity::class.java),
|
ComponentName(context, ComponentActivity::class.java),
|
||||||
|
|||||||
Reference in new issue
Block a user