Commit 33f33afe31

33f33afe3129b211f2a259d21124a262a68ba5bb

parent: 1ce9486b6f

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-22 21:36 UTC

live suite: check that the label filter narrows the list

testMRLabelFlow's fixture MR was the only open MR on the repo, so
asserting it stayed listed after filtering passed even without the
filter doing anything. Open a second, unlabelled MR the other way and
assert the filter drops it, so the test can actually fail if --label
stops being sent.

Layout: unified · split

gitbayUITests/LiveSmokeUITests.swift +10 −2
@@ -87,8 +87,11 @@ final class LiveSmokeUITests: XCTestCase {
87 closeSmokeMergeRequests() 87 closeSmokeMergeRequests()
88 _ = runCommand(["mr", "create", Self.fixtureRepo, "--source", "ui-smoke", "--target", "main", 88 _ = runCommand(["mr", "create", Self.fixtureRepo, "--source", "ui-smoke", "--target", "main",
89 "--title", Self.labelledTitle]) 89 "--title", Self.labelledTitle])
90 try XCTSkipUnless(openSmokeMergeRequests().map { $0.title }.contains(Self.labelledTitle), 90 _ = runCommand(["mr", "create", Self.fixtureRepo, "--source", "main", "--target", "ui-smoke",
91 "could not open the label fixture merge request on \(Self.fixtureRepo)") 91 "--title", Self.unlabelledTitle])
92 let open = openSmokeMergeRequests().map { $0.title }
93 try XCTSkipUnless(open.contains(Self.labelledTitle) && open.contains(Self.unlabelledTitle),
94 "could not open both label fixture merge requests on \(Self.fixtureRepo)")
92 } 95 }
93 } 96 }
94 97
@@ -152,6 +155,7 @@ final class LiveSmokeUITests: XCTestCase {
152 static let supersededTitle = "UI smoke: superseded" 155 static let supersededTitle = "UI smoke: superseded"
153 static let successorTitle = "UI smoke: successor" 156 static let successorTitle = "UI smoke: successor"
154 static let labelledTitle = "UI smoke: labels" 157 static let labelledTitle = "UI smoke: labels"
158 static let unlabelledTitle = "UI smoke: unlabelled"
155 static let smokeMRLabel = "ui-smoke-mr-label" 159 static let smokeMRLabel = "ui-smoke-mr-label"
156 160
157 /// Close in favour needs two open merge requests. The fixture branch 161 /// Close in favour needs two open merge requests. The fixture branch
@@ -1869,6 +1873,8 @@ extension LiveSmokeUITests {
1869 XCTAssertTrue(remove.waitForExistence(timeout: 15), "added label has no chip") 1873 XCTAssertTrue(remove.waitForExistence(timeout: 15), "added label has no chip")
1870 1874
1871 back() 1875 back()
1876 XCTAssertTrue(app.staticTexts[Self.unlabelledTitle].firstMatch.waitForExistence(timeout: 15),
1877 "unlabelled fixture MR not listed")
1872 app.descendants(matching: .any).matching(identifier: "mr-filter-button").firstMatch.tap() 1878 app.descendants(matching: .any).matching(identifier: "mr-filter-button").firstMatch.tap()
1873 let menu = app.descendants(matching: .any).matching(identifier: "filter-label-menu").firstMatch 1879 let menu = app.descendants(matching: .any).matching(identifier: "filter-label-menu").firstMatch
1874 XCTAssertTrue(menu.waitForExistence(timeout: 10), "MR filter sheet has no label picker") 1880 XCTAssertTrue(menu.waitForExistence(timeout: 10), "MR filter sheet has no label picker")
@@ -1878,6 +1884,8 @@ extension LiveSmokeUITests {
1878 choice.tap() 1884 choice.tap()
1879 app.buttons["Done"].firstMatch.tap() 1885 app.buttons["Done"].firstMatch.tap()
1880 XCTAssertTrue(row.waitForExistence(timeout: 15), "label filter dropped the labelled MR") 1886 XCTAssertTrue(row.waitForExistence(timeout: 15), "label filter dropped the labelled MR")
1887 XCTAssertTrue(app.staticTexts[Self.unlabelledTitle].firstMatch.waitForNonExistence(timeout: 15),
1888 "label filter did not narrow the list")
1881 1889
1882 row.tap() 1890 row.tap()
1883 XCTAssertTrue(scrollTo(remove), "chip missing on reopen") 1891 XCTAssertTrue(scrollTo(remove), "chip missing on reopen")