Skip to content

Commit 35fedde

Browse files
committed
[resources] Fix test environment.
1 parent 99458da commit 35fedde

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

components/resources/library/src/commonTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class ComposeResourceTest {
307307
@OptIn(ExperimentalResourceApi::class)
308308
@Test
309309
fun testGetResourceBytes() = runTest {
310-
val env = getSystemEnvironment()
310+
val env = getSystemResourceEnvironment()
311311
val imageBytes = getDrawableResourceBytes(env, TestDrawableResource("1.png"))
312312
assertEquals(946, imageBytes.size)
313313
val fontBytes = getFontResourceBytes(env, TestFontResource("font_awesome.otf"))
@@ -319,11 +319,13 @@ class ComposeResourceTest {
319319
fun testGetResourceEnvironment() = runComposeUiTest {
320320
var environment: ResourceEnvironment? = null
321321
setContent {
322-
environment = rememberResourceEnvironment()
322+
CompositionLocalProvider(LocalComposeEnvironment provides TestComposeEnvironment) {
323+
environment = rememberResourceEnvironment()
324+
}
323325
}
324326
waitForIdle()
325327

326-
val systemEnvironment = getSystemEnvironment()
328+
val systemEnvironment = getSystemResourceEnvironment()
327329
assertEquals(systemEnvironment, environment)
328330
}
329331
}

0 commit comments

Comments
 (0)