Cotton code
40 lines · 2.1 KB · SwiftRaw
// Days' Look (shared/DECISIONS.md "Look"): Settings' Look row opens the shared screen; the papers' halves, the ink,// the face and the size follow a tap; Reset asks in Days' own card and brings back Grey, Grey, Blue, DM Mono,// Standard; a choice stands after a relaunch; at the largest text Reset is reached. No test per look.import XCTestfinal class DaysLookTests: XCTestCase {    override func setUp() { continueAfterFailure = false }    @MainActor private static func open(_ extra: [String] = []) -> XCUIApplication {        let app = DaysUI.launch(["-days-open", "settings"] + extra)        let row = LookUI.id(app, "settings-row-look")        XCTAssertTrue(row.waitForExistence(timeout: 60), "Look stands in Days' settings")        row.tap()        return app    }    private let look = LookCase(open: { DaysLookTests.open() },                                defaults: (light: "grey", dark: "grey", ink: "blue", face: "own", size: "Standard"),                                other: (light: "cream", dark: "night", ink: "green", face: "serif"),                                resetAct: "days-look-reset-go")    // RULE: each half, the ink, the face and the size follow a tap; Reset asks first and brings the defaults back.    @MainActor func testSelectionAndReset() { look.selectionAndReset() }    // RULE: a choice stands after the app opens again.    @MainActor func testCarryOver() { look.carryOver() }    // RULE (owner, 23 Nov 2026: "choosing a font changes nothing" on his iPhone): a face chosen reaches the drawn words    // and stands when the app opens again, also on a server deployed before Look.    @MainActor func testPaperRowsAndTheSample() { look.paperRowsAndTheSample() }    @MainActor func testAFaceReachesTheWords() { look.faceReachesTheWords({ DaysLookTests.open($0) }) }    // RULE: at the largest text, Reset at the foot is reached.    @MainActor func testLargestText() { look.largestText { DaysLookTests.open(DaysUI.largestText) } }    // The quick look: each paper and each face on the app's first screen, kept as attachments (no assertion per look).    @MainActor func testQuickLook() { look.quickLook { DaysUI.launch() } }}