package com.cottondb.daysimport android.app.Applicationimport androidx.compose.runtime.Composableimport androidx.compose.runtime.CompositionLocalProviderimport com.cottondb.days.pen.DaysCardLookimport com.cottondb.days.pen.PenThemeimport com.cottondb.days.ui.DaysSettingsimport com.cottondb.days.ui.DaysSkinimport com.cottondb.days.ui.daysOwnRowsimport com.cottondb.settings.SettingsCheckimport com.cottondb.shell.LocalCardLookimport com.cottondb.shell.core.CottonCoreimport kotlinx.serialization.json.jsonObjectimport org.junit.Assert.assertEqualsimport org.junit.Ruleimport org.junit.Testimport org.junit.runner.RunWithimport org.robolectric.RobolectricTestRunnerimport org.robolectric.annotation.Config/** * Days' Settings, organised as Comms' You (owner, 23 Nov 2026): the profile card, Days' own rows (Google calendars, * Week starts on), then Sync, Your Claude, Privacy, Notifications (with Days' alerts), Storage, Help and feedback and * About, each opening its page; every act a person had still reachable; nothing said raw. Before, one long page held * the calendars, the week, the account and its acts, Your people, the recovery code, passkeys, the assistant, Delete * account, Storage, Help and About in a row. Invented answers, the kit's own words. */@RunWith(RobolectricTestRunner::class)@Config(sdk = [35], qualifiers = "w400dp-h800dp-mdpi", application = Application::class)classDaysSettingsTest { @get:Ruleval compose = androidx.compose.ui.test.junit4.createComposeRule()privateval wrap: @Composable (@Composable () -> Unit) -> Unit = { content -> PenTheme { CompositionLocalProvider(LocalCardLook provides DaysCardLook(com.cottondb.days.pen.penType())) { content() } } }privateval google = CottonCore.json.parseToJsonElement("""{"accounts":[{"email":"pema.walktest@example.com","says":"Last brought in today at 9:05 · 12 events"}]}""").jsonObjectprivatefun own(@Suppress("UNUSED_PARAMETER") done: SettingsCheck.Done) = daysOwnRows(SettingsCheck.lines("Days"), google, DaysSettings(weekStart = 1)) @Test fun days_own_rows_say_how_they_stand() {val rows = daysOwnRows(SettingsCheck.lines("Days"), google, DaysSettings(weekStart = 7)) assertEquals(listOf("google", "week", "export"), rows.map { it.id }) assertEquals(listOf("Google calendars", "Week starts on", "Export"), rows.map { it.label }) assertEquals(listOf("pema.walktest@example.com", "Sunday", "Your events and to-dos as a calendar file."), rows.map { it.line }) assertEquals("No Google calendar connected.", daysOwnRows(SettingsCheck.lines("Days"), null, DaysSettings(1))[0].line) } @Test fun signed_in_the_card_then_days_own_then_comms_rows_and_every_act_reachable() {SettingsCheck.signedInCheck(compose, "Days", DaysSkin(null), wrap, listOf("google", "week", "export"), ::own, notifies = true) }// Owner, build 24: the card drew first and the rows a second or two later. @Test fun every_row_stands_on_the_first_frame_and_fills_in_place() =SettingsCheck.firstFrameCheck(compose, "Days", DaysSkin(null), wrap, listOf("google", "week", "export"), ::own, notifies = true) @Test fun signed_out_the_card_signs_in() = SettingsCheck.signedOutCheck(compose, "Days", DaysSkin(null), wrap, ::own)}