package com.cottondb.days import android.app.Application import androidx.compose.ui.test.assertIsEnabled import androidx.compose.ui.test.hasClickAction import androidx.compose.ui.test.hasText import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.performClick import androidx.compose.ui.text.font.FontFamily import com.cottondb.days.pen.DaysCardLook import com.cottondb.days.pen.PenType 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 /** * The shell's yes-or-no cards over Days (a reason before the phone's ask, a question before an act): Not now closes * the card. It was passed as disabled, drawn greyed and dead, as Story's was (first-run walk, 25 Nov 2026). */ @RunWith(RobolectricTestRunner::class) @Config(sdk = [35], qualifiers = "w411dp-h891dp-mdpi", application = Application::class) class DaysConfirmCardTest { @get:Rule val compose = createComposeRule() @Test fun not_now_closes_the_card() { var dismissed = 0 var went = 0 compose.setContent { DaysCardLook(PenType(FontFamily.Monospace)).Confirm("Days reminds you with a notification.", "Continue", "days-ask-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) } } }