// A passing line the shell says, as each app's tests check it (lane // chat-warm-ios, 22 Nov 2026): in Words, Days, Story and Comms it is drawn // once, in the app's own toast (`toast-words`, `toast-days`, `toast-story`, // `toast-comms`), and the old paper strip (`toast-paper`) and the generic look's // card (`toast-look`) never stand. Raised by refusing the invented Walk Mac // (`-shell-card-seed YES`, a development build only): it reaches no server, // and its Refuse says "Refused. Walk Mac was not signed in." through the // shell's own `say`, as a real refusal's words are. Never a real request. import XCTest enum ShellToastUI { /// The shell's line the invented card's Refuse says. static let refused = "Refused. Walk Mac was not signed in." @MainActor static func all(_ app: XCUIApplication, _ identifier: String) -> XCUIElementQuery { app.descendants(matching: .any).matching(identifier: identifier) } /// Refuse the invented card, and confirm it on the app's own ask. @MainActor static func refuseTheSeed(_ app: XCUIApplication, file: StaticString = #filePath, line: UInt = #line) { let refuse = app.buttons.matching(NSPredicate(format: "identifier BEGINSWITH %@", "approval-")).firstMatch XCTAssertTrue(refuse.waitForExistence(timeout: 60), "the invented card stands", file: file, line: line) for _ in 0..<4 where !refuse.isHittable { app.swipeUp(velocity: .slow) } refuse.tap() let yes = app.buttons["vault-confirm-yes"] XCTAssertTrue(yes.waitForExistence(timeout: 10), "Refuse asks first", file: file, line: line) yes.tap() } /// The line stands once, in `own`, and neither the paper strip nor the look's card stands, while it shows and after. @MainActor static func drawnOnceIn(_ app: XCUIApplication, own: String, file: StaticString = #filePath, line: UInt = #line) { let toast = all(app, own).firstMatch XCTAssertTrue(toast.waitForExistence(timeout: 10), "the line stands in the app's own toast (\(own))", file: file, line: line) XCTAssertEqual(all(app, own).count, 1, "the line is drawn once", file: file, line: line) let words = app.staticTexts.matching(NSPredicate(format: "label == %@", refused)) XCTAssertEqual(words.count, 1, "its words stand once on screen", file: file, line: line) XCTAssertTrue(toast.staticTexts[refused].exists, "the app's toast says the shell's words", file: file, line: line) for old in ["toast-paper", "toast-look"] { XCTAssertFalse(all(app, old).firstMatch.exists, "no \(old) stands beside it", file: file, line: line) } // It goes by itself, and nothing else rises after it. let gone = NSPredicate(format: "exists == false") XCTWaiter().wait(for: [XCTNSPredicateExpectation(predicate: gone, object: toast)], timeout: 8) XCTAssertFalse(toast.exists, "the line goes by itself", file: file, line: line) for old in ["toast-paper", "toast-look"] { XCTAssertFalse(all(app, old).firstMatch.exists, "no \(old) after it", file: file, line: line) } } }