I have some Compose UI tests that need to read str...
# compose-desktop
c
I have some Compose UI tests that need to read string resources, to check that UI values match expected values.
getString()
is a
suspend
fun, while
stringResource()
is a
@Composable
fun.
runComposeUiTest
doesn’t give us a Composable scope or a coroutine scope. So what’s the expected way to read resources in
commonTest
? Do we nest
runTest
inside
runComposeUiTest
?
a
setContent to get a composable context
and runBlocking to get a suspending context
c
Sure, although setContent isn’t really appropriate for calling
stringResource()
for a test assertion. Is
runBlocking
supported by all targets (e.g. JS)?
a
@Konstantin Tskhovrebov Do we have a blocking alternative?
k
no. because JS cannot be blocked. there must be the async API only
c
What about nesting
runTest
?