import Foundation import XCTest @testable import CottonUI /// Walker 298, on the real reader copy: with the fan bloomed VoiceOver still /// reached "ICICI card statement" under it. The fan's hide sat on the face /// inside each row's button, and the button — which names itself — read on; /// a cover-grid row had no hide at all. final class BloomedFanHidesWholeRowsTests: XCTestCase { /// RULE: with the fan bloomed, every list row under it is out of the accessibility tree as a whole row (its press, its acts, its name), and with the fan folded it reads again, because a row the fan covers takes no tap and so must not be announced (ruling 16 Oct 2026 21:15 IST). func testTheBloomedFanHidesTheWholeRowUnderItAndTheFoldedFanDoesNot() throws { // Bloomed: the cover stands at the fan's top; a row whose middle is below it is covered. let bloomed = FanRoom.cover(collapsed: false, tucked: false, keyboardUp: false, areaFoot: 600) XCTAssertEqual(bloomed, 600) XCTAssertTrue(UnreadUnderTheFan.covered(midY: 640, cover: bloomed), "a row under the bloomed fan is hidden") XCTAssertFalse(UnreadUnderTheFan.covered(midY: 300, cover: bloomed), "a row above the fan reads") // Folded: no cover, every row reads. let folded = FanRoom.cover(collapsed: true, tucked: false, keyboardUp: false, areaFoot: 600) XCTAssertNil(folded) XCTAssertFalse(UnreadUnderTheFan.covered(midY: 640, cover: folded), "the folded band hides nothing") // The hide stands on the row's outermost view, around its button. func rows(_ path: String) throws -> String { SourceSweep.withoutComments(try SourceSweep.mustRead(path, ownedBy: "phonefixes")).filter { !$0.isWhitespace } } let list = try rows("apps/cotton/Sources/CottonUI/Surfaces/RecordListSurface.swift") XCTAssertTrue(list.contains("pressed(content).modifier(UnreadUnderTheFan())"), "every list row (slip, cover, polaroid) is hidden whole, through its press menu") XCTAssertTrue(list.contains("sheetCell(record).modifier(UnreadUnderTheFan())"), "a contact sheet's square is hidden whole") let section = try rows("apps/cotton/Sources/CottonUI/Surfaces/RecordsSection.swift") XCTAssertEqual(section.components(separatedBy: ".modifier(UnreadUnderTheFan())").count - 1, 3, "a record page's section rows (link slip, slip, page) are hidden whole") for part in ["Surfaces/Board/AskedBand.swift", "Surfaces/Board/BoardNotices.swift", "Faces/BoardTile.swift", "Surfaces/Board/ArrivalTile.swift"] { XCTAssertTrue(try rows("apps/cotton/Sources/CottonUI/" + part).contains(".modifier(UnreadUnderTheFan())"), "\(part)'s rows leave the tree under the bloomed fan") } } }