Cotton code
29 lines · 1.6 KB · SwiftRaw
// The shell's card of another device asking to be let in (an invented Walk// Mac, -shell-card-seed YES) stands above Words and pushes it down: the// list's place and More, and a note's Back, Info and More stay clear of it// and can be touched (a note, drawn over the whole window, covers the card),// and the card takes at most half the screen with Refuse whole, at the// default size and the largest. The card is never tapped.import XCTestfinal class NotesShellCardTests: NotesUITestCase {    @MainActor private func walk(_ extra: [String]) {        let app = NotesUI.launch(ShellCard.seed + extra)        NotesUI.list(app)        ShellCard.fits(app)        ShellCard.clear(app, NotesUI.id(app, "notes-place"), "the list's place")        ShellCard.clear(app, NotesUI.id(app, "notes-more"), "the list's More")        app.terminate()        let note = NotesUI.launch(ShellCard.seed + ["-notes-open", "note"] + extra)        ShellCard.clear(note, NotesUI.id(note, "note-back"), "a note's Back")        ShellCard.clear(note, NotesUI.id(note, "note-info"), "a note's Info")        ShellCard.clear(note, NotesUI.id(note, "note-more"), "a note's More")    }    // RULE: with the card standing, the list's place and More and a note's Back, Info and More are clear of it and can be touched.    @MainActor func testTheCardPushesWordsDown() { walk([]) }    // RULE: at the largest text the card stays within half the screen with Refuse whole, and Words' top controls are clear of it.    @MainActor func testTheCardPushesWordsDownAtTheLargestText() { walk(NotesUI.largestText) }}