Commit 898da24eee
Unsigned
Layout: unified · split
DomainDig/ContentView.swift +4
| @@ -593,6 +593,7 @@ struct ContentView: View { | |||
| 593 | // WCAG 2.5.8 floor, which is what the audit reports here. | 593 | // WCAG 2.5.8 floor, which is what the audit reports here. |
| 594 | .frame(minWidth: AppLayout.minimumTapTarget, minHeight: AppLayout.minimumTapTarget) | 594 | .frame(minWidth: AppLayout.minimumTapTarget, minHeight: AppLayout.minimumTapTarget) |
| 595 | .contentShape(Rectangle()) | 595 | .contentShape(Rectangle()) |
| 596 | .buttonStyle(.borderless) | ||
| 596 | .accessibilityLabel("Clear recent searches") | 597 | .accessibilityLabel("Clear recent searches") |
| 597 | } | 598 | } |
| 598 | 599 | ||
| @@ -611,6 +612,9 @@ struct ContentView: View { | |||
| 611 | .background(ThemeToken.surface) | 612 | .background(ThemeToken.surface) |
| 612 | .clipShape(RoundedRectangle(cornerRadius: appDensity.metrics.cardCornerRadius)) | 613 | .clipShape(RoundedRectangle(cornerRadius: appDensity.metrics.cardCornerRadius)) |
| 613 | } | 614 | } |
| 615 | // Every button in this one List row fires on a tap unless it | ||
| 616 | // is borderless. | ||
| 617 | .buttonStyle(.borderless) | ||
| 614 | // A bare domain reads as neither a word nor an action; the | 618 | // A bare domain reads as neither a word nor an action; the |
| 615 | // button re-runs the lookup, so say that. | 619 | // button re-runs the lookup, so say that. |
| 616 | .accessibilityLabel("Look up \(domain)") | 620 | .accessibilityLabel("Look up \(domain)") |
DomainDigUITests/RecentSearchesTests.swift added +32
| @@ -0,0 +1,32 @@ | |||
| 1 | import XCTest | ||
| 2 | |||
| 3 | @MainActor | ||
| 4 | final class RecentSearchesTests: XCTestCase { | ||
| 5 | |||
| 6 | override func setUp() { | ||
| 7 | continueAfterFailure = false | ||
| 8 | } | ||
| 9 | |||
| 10 | /// Run one recent search, clear the results, then pick a different one. | ||
| 11 | /// The second pick must run the domain that was tapped, not the one run | ||
| 12 | /// before it. | ||
| 13 | func testTappingARecentSearchRunsThatDomain() { | ||
| 14 | let app = AccessibilityAuditHarness.launch(recentSearches: true) | ||
| 15 | app.selectRootTab("Inspect") | ||
| 16 | |||
| 17 | let field = app.textFields["e.g. cleberg.net"] | ||
| 18 | XCTAssertTrue(field.waitForExistence(timeout: 10)) | ||
| 19 | |||
| 20 | app.buttons["Look up healthy.example"].tap() | ||
| 21 | XCTAssertEqual(field.value as? String, "healthy.example") | ||
| 22 | |||
| 23 | let clear = app.buttons["Cancel lookup"].exists ? app.buttons["Cancel lookup"] : app.buttons["Clear results"] | ||
| 24 | clear.tap() | ||
| 25 | |||
| 26 | let next = app.buttons["Look up broken.example"] | ||
| 27 | XCTAssertTrue(next.waitForExistence(timeout: 10)) | ||
| 28 | next.tap() | ||
| 29 | |||
| 30 | XCTAssertEqual(field.value as? String, "broken.example") | ||
| 31 | } | ||
| 32 | } | ||