Cotton code
38 lines · 2.1 KB · KotlinRaw
package com.cottondb.storeimport org.junit.Assert.assertFalseimport org.junit.Assert.assertTrueimport org.junit.Testimport java.io.File/** STORE READY (26 Nov 2026): the shell's own pages, as the Words, Days and Story walks found them. */class StoreReadyShellTest {    private val repo = generateSequence(File("").absoluteFile) { it.parentFile }.first { File(it, "apps/registry.json").isFile }    private fun shell(name: String) = File(repo, "apps/android/shell/src/main/kotlin/com/cottondb/shell/$name").readText()    private fun app(path: String) = File(repo, "apps/android/app/src/$path").readText()    /** The Delete account, sign-in and gate pages keep the look's room from the sides; Words, Days and Story keep none of their own. */    @Test    fun sheets_keep_the_looks_room_from_the_sides() {        assertTrue(shell("CardLook.kt").contains("val sheetInset: Dp get() = 28.dp"))        listOf("DeleteAccountPart.kt", "SignIn.kt", "Gate.kt").forEach { assertTrue(it, shell(it).contains("sheetInset")) }        listOf("notes/kotlin/com/cottondb/notes/NotesCardLook.kt", "days/kotlin/com/cottondb/days/pen/DaysCardLook.kt", "story/kotlin/com/cottondb/story/ink/InkCardLook.kt")            .forEach { assertTrue(it, app(it).contains("override val sheetInset: Dp = 0.dp")) }    }    /** Reset sends each choice not at its default, as the iPhone does, never `reset: true` (which left Days' Night dark paper standing). */    @Test    fun look_reset_sends_what_differs() {        val look = shell("look/Look.kt")        assertTrue(look.contains("resetAsk(answer)"))        assertFalse(look.contains("""put("reset", JsonPrimitive(true))"""))    }    /** Privacy's acts say whose they are; Passkeys is a heading; the getting-in page's two ways out stand the same height. */    @Test    fun spoken_names_headings_and_equal_buttons() {        assertTrue(shell("YourPeople.kt").contains("spoken = \"\${act.words}, \$whose\""))        assertTrue(shell("PasskeyPart.kt").contains("heading()"))        assertTrue(shell("GettingInPage.kt").contains("IntrinsicSize.Min"))    }}