summaryrefslogtreecommitdiff
path: root/SoraTests/ViewDerivedDataTests.swift
diff options
context:
space:
mode:
Diffstat (limited to 'SoraTests/ViewDerivedDataTests.swift')
-rw-r--r--SoraTests/ViewDerivedDataTests.swift30
1 files changed, 30 insertions, 0 deletions
diff --git a/SoraTests/ViewDerivedDataTests.swift b/SoraTests/ViewDerivedDataTests.swift
index 32e9276..26410f8 100644
--- a/SoraTests/ViewDerivedDataTests.swift
+++ b/SoraTests/ViewDerivedDataTests.swift
@@ -397,6 +397,36 @@ final class ViewDerivedDataTests: XCTestCase { // swiftlint:disable:this type_b
)
}
+ func testFavoritesRemoveAllAlertUsesDestructiveRole() throws {
+ let source = try loadSource(at: "Sora/Views/FavoritesView.swift")
+ let destructiveRemoveAllCount = tokenCount(
+ matching: #"Button\("Remove All Favorites",\s*role:\s*\.destructive\)"#,
+ in: source
+ )
+
+ // swiftlint:disable:next prefer_nimble
+ XCTAssertGreaterThan(
+ destructiveRemoveAllCount,
+ 0,
+ "Favorites remove-all confirmation should mark the destructive action with role."
+ )
+ }
+
+ func testGenericListRemoveAllAlertUsesDestructiveRole() throws {
+ let source = try loadSource(at: "Sora/Views/Generic/GenericListView.swift")
+ let destructiveRemoveAllCount = tokenCount(
+ matching: #"Button\(removeAllButtonText,\s*role:\s*\.destructive\)"#,
+ in: source
+ )
+
+ // swiftlint:disable:next prefer_nimble
+ XCTAssertGreaterThan(
+ destructiveRemoveAllCount,
+ 0,
+ "Generic list remove-all confirmation should mark the destructive action with role."
+ )
+ }
+
func testListViewsAvoidComparatorRandomShuffleSorting() throws {
let listViewSource = try loadSource(at: "Sora/Views/Generic/GenericListView.swift")
let favoritesViewSource = try loadSource(at: "Sora/Views/FavoritesView.swift")