package com.cottondb.story import android.app.Application import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithContentDescription import androidx.compose.ui.test.performClick import com.cottondb.story.ink.NoScriptsTitle import org.junit.Assert.assertEquals import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config /** * A Story with no script yet reaches Settings from its title row. On the emulator (21 Nov 2026) a fresh Story, and one * cleared to sign in again, offered only New script and Bring in a script: Settings (and with it Sign in) stood behind * a script's More. */ @RunWith(RobolectricTestRunner::class) @Config(sdk = [35], qualifiers = "w400dp-h800dp-mdpi", application = Application::class) class StoryNoScriptsSettingsTest { @get:Rule val compose = createComposeRule() @Test fun settings_stands_beside_the_title_before_a_first_script() { var opened = 0 compose.setContent { NoScriptsTitle("Story", "Settings") { opened++ } } compose.onNodeWithContentDescription("Settings").assertIsDisplayed().performClick() compose.runOnIdle { assertEquals(1, opened) } } }