package com.cottondb.storyimport android.app.Applicationimport androidx.compose.runtime.getValueimport androidx.compose.runtime.mutableIntStateOfimport androidx.compose.runtime.setValueimport androidx.compose.ui.test.junit4.createComposeRuleimport com.cottondb.story.ink.Currentimport com.cottondb.story.ink.InkStateimport org.junit.Assert.assertEqualsimport org.junit.Assert.assertNullimport org.junit.Ruleimport org.junit.Testimport org.junit.runner.RunWithimport org.robolectric.RobolectricTestRunnerimport org.robolectric.annotation.Config/** * A Story that said "Nothing here yet" asks again when a change lands. On the emulator (21 Nov 2026) a phone signed in * again and opened with its recovery code kept "Nothing here yet" over the person's invented 180-scene script until * Story was closed and opened again. */@RunWith(RobolectricTestRunner::class)@Config(sdk = [35], qualifiers = "w400dp-h800dp-mdpi", application = Application::class)classStoryAskAgainTest { @get:Ruleval compose = createComposeRule() @Test fun a_script_that_becomes_readable_comes_home_on_the_next_change() {val state = InkState() state.come(Current(story = null, arriving = null))var answer = Current(story = null, arriving = null)var revision by mutableIntStateOf(0) compose.setContent { AskWhileNoScript(state, revision) { answer } } compose.waitForIdle() assertNull(state.story)// The key opens and the core can read the script: the next change that lands brings it home. answer = Current(story = "invented-harbour", arriving = null) compose.runOnIdle { revision++ } compose.waitForIdle() assertEquals("invented-harbour", state.story) }}