Browse Source

[resources] Fix test environment.

pull/4695/head
Konstantin Tskhovrebov 7 months ago
parent
commit
35fedde768
  1. 6
      components/resources/library/src/commonTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt

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

@ -307,7 +307,7 @@ class ComposeResourceTest {
@OptIn(ExperimentalResourceApi::class)
@Test
fun testGetResourceBytes() = runTest {
val env = getSystemEnvironment()
val env = getSystemResourceEnvironment()
val imageBytes = getDrawableResourceBytes(env, TestDrawableResource("1.png"))
assertEquals(946, imageBytes.size)
val fontBytes = getFontResourceBytes(env, TestFontResource("font_awesome.otf"))
@ -319,11 +319,13 @@ class ComposeResourceTest {
fun testGetResourceEnvironment() = runComposeUiTest {
var environment: ResourceEnvironment? = null
setContent {
CompositionLocalProvider(LocalComposeEnvironment provides TestComposeEnvironment) {
environment = rememberResourceEnvironment()
}
}
waitForIdle()
val systemEnvironment = getSystemEnvironment()
val systemEnvironment = getSystemResourceEnvironment()
assertEquals(systemEnvironment, environment)
}
}

Loading…
Cancel
Save