package com.cottondb.storyimport android.app.Applicationimport androidx.compose.ui.test.assertIsEnabledimport androidx.compose.ui.test.hasClickActionimport androidx.compose.ui.test.hasTextimport androidx.compose.ui.test.junit4.createComposeRuleimport androidx.compose.ui.test.performClickimport androidx.compose.ui.text.font.FontFamilyimport com.cottondb.story.ink.InkCardLookimport com.cottondb.story.ink.InkTypeimport org.junit.Assert.assertEqualsimport org.junit.Ruleimport org.junit.Testimport org.junit.runner.RunWithimport org.robolectric.RobolectricTestRunnerimport org.robolectric.annotation.Config/** * The shell's yes-or-no cards over Story (the microphone's reason before the phone's ask): Not now closes the card, * and Continue goes on (drawn as the main button, filled in the ballpoint blue: seen on the emulator). On the emulator (first-run walk, 25 Nov 2026) Not now * was drawn greyed and did nothing, so only Back closed the card, and Continue was outlined. */@RunWith(RobolectricTestRunner::class)@Config(sdk = [35], qualifiers = "w411dp-h891dp-mdpi", application = Application::class)classStoryConfirmCardTest { @get:Ruleval compose = createComposeRule()privateval why = "Story uses the microphone only while you dictate, to write down what you say." @Test fun not_now_closes_the_card() {var dismissed = 0var went = 0 compose.setContent {InkCardLook(InkType(FontFamily.Monospace, FontFamily.Monospace)).Confirm(why, "Continue", "voice-mic-go-on", onYes = { went++ }, onDismiss = { dismissed++ }, no = "Not now") } compose.onNode(hasText("Not now") and hasClickAction(), useUnmergedTree = true).assertIsEnabled().performClick() compose.runOnIdle { assertEquals(1, dismissed); assertEquals(0, went) } } @Test fun continue_goes_on() {var went = 0 compose.setContent {InkCardLook(InkType(FontFamily.Monospace, FontFamily.Monospace)).Confirm(why, "Continue", "voice-mic-go-on", onYes = { went++ }, onDismiss = {}, no = "Not now") } compose.onNode(hasText("Continue") and hasClickAction(), useUnmergedTree = true).performClick() compose.runOnIdle { assertEquals(1, went) } }}