Cotton code
34 lines · 1.8 KB · SwiftRaw
import CottonKitimport Foundationimport XCTest@testable import CottonUI@MainActorfinal class MeetingDefinitionTests: XCTestCase {    /// RULE: Recording is an act on the meetings list: /meetings/record takes the list's place rather than stacking a second list; a link never replaces a recorder that is up; and closing or filing spends the entry so the plain list is left (with the meeting's page over it once filed).    func testRecordingIsAnActOnTheMeetingsList() throws {        let navigator = Navigator()        navigator.push(.meetings(importing: false))        navigator.push(.meetingsRecord)        XCTAssertEqual(navigator.stack, [.meetingsRecord], "the list's act raises the recorder over the same list")        navigator.push(.meetings(importing: false))        navigator.push(.meetings(importing: true))        navigator.push(.meetingsRecord)        navigator.open(.meetingsRecord)        XCTAssertEqual(navigator.stack, [.meetingsRecord], "a link never tears down a recorder that is up")        let meetingPage = Route.meetingsMeeting(id: "example-meeting")        XCTAssertEqual(            MeetingListFlow.leavingRecorder(.toTheList, over: [.home, .meetingsRecord]),            [.home, .meetings(importing: false)])        XCTAssertEqual(            MeetingListFlow.leavingRecorder(.toTheMeeting(meetingPage), over: [.home, .meetingsRecord]),            [.home, .meetings(importing: false), meetingPage])    }    /// RULE: A player slip prints duration and time together so setting one does not hide the other.    func testPlayerSlipKeepsTimeBesideDuration() {        XCTAssertEqual(SlipFace.playerLine(subtitle: "18 min", trailing: "09:00"), "18 min · 09:00")        XCTAssertEqual(SlipFace.playerLine(subtitle: "09:00", trailing: "09:00"), "09:00")    }}