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 {
8787 closeSmokeMergeRequests()
8888 _ = runCommand(["mr", "create", Self.fixtureRepo, "--source", "ui-smoke", "--target", "main",
8989 "--title", Self.labelledTitle])
90 try XCTSkipUnless(openSmokeMergeRequests().map { $0.title }.contains(Self.labelledTitle),
91 "could not open the label fixture merge request on \(Self.fixtureRepo)")
90 _ = runCommand(["mr", "create", Self.fixtureRepo, "--source", "main", "--target", "ui-smoke",
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)")
9295 }
9396 }
9497
@@ -152,6 +155,7 @@ final class LiveSmokeUITests: XCTestCase {
152155 static let supersededTitle = "UI smoke: superseded"
153156 static let successorTitle = "UI smoke: successor"
154157 static let labelledTitle = "UI smoke: labels"
158 static let unlabelledTitle = "UI smoke: unlabelled"
155159 static let smokeMRLabel = "ui-smoke-mr-label"
156160
157161 /// Close in favour needs two open merge requests. The fixture branch
@@ -1869,6 +1873,8 @@ extension LiveSmokeUITests {
18691873 XCTAssertTrue(remove.waitForExistence(timeout: 15), "added label has no chip")
18701874
18711875 back()
1876 XCTAssertTrue(app.staticTexts[Self.unlabelledTitle].firstMatch.waitForExistence(timeout: 15),
1877 "unlabelled fixture MR not listed")
18721878 app.descendants(matching: .any).matching(identifier: "mr-filter-button").firstMatch.tap()
18731879 let menu = app.descendants(matching: .any).matching(identifier: "filter-label-menu").firstMatch
18741880 XCTAssertTrue(menu.waitForExistence(timeout: 10), "MR filter sheet has no label picker")
@@ -1878,6 +1884,8 @@ extension LiveSmokeUITests {
18781884 choice.tap()
18791885 app.buttons["Done"].firstMatch.tap()
18801886 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")
18811889
18821890 row.tap()
18831891 XCTAssertTrue(scrollTo(remove), "chip missing on reopen")