Cotton code
41 lines · 2.3 KB · SwiftRaw
// Comms' Look (shared/DECISIONS.md "Look"): You's Look row opens the shared screen; the papers' halves, the ink, the// face and the size follow a tap; Reset asks in Comms' own panel and brings back Warm, Warm, Terracotta, Hanken// Grotesk, Standard; a choice stands after a relaunch; at the largest text Reset is reached. No test per look.import XCTestfinal class ChatLookTests: XCTestCase {    override func setUp() { continueAfterFailure = false }    @MainActor private static func open(_ extra: [String] = []) -> XCUIApplication {        let app = XCUIApplication()        app.launchArguments += ["-chat-warm-seed", "YES", "-chat-warm-place", "you", "-chat-warm-you", "look"] + extra        app.launch()        return app    }    private let look = LookCase(open: { ChatLookTests.open() },                                defaults: (light: "warm", dark: "warm", ink: "terracotta", face: "own", size: "Standard"),                                other: (light: "mist", dark: "dusk", ink: "blue", face: "dyslexic"),                                resetAct: "look-ask-look-reset")    // 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({ ChatLookTests.open($0) }) }    // RULE: at the largest text, Reset at the foot is reached.    @MainActor func testLargestText() {        look.largestText { ChatLookTests.open(["-UIPreferredContentSizeCategoryName", "UICTContentSizeCategoryAccessibilityXXXL"]) }    }    // 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 { { let a = XCUIApplication(); a.launchArguments += ["-chat-warm-seed", "YES", "-chat-warm-place", "chats"]; a.launch(); return a }() } }}