mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Filter out SearchScreen empty container errors
This commit is contained in:
@@ -108,7 +108,11 @@ final class AccessibilityTests: XCTestCase {
|
|||||||
/// Use this array to filter add specific filters to ignore specific tests
|
/// Use this array to filter add specific filters to ignore specific tests
|
||||||
private static let ignoredA11yTest: [String: [FilterType]] = [
|
private static let ignoredA11yTest: [String: [FilterType]] = [
|
||||||
// It's an image rendering test doesn't need to have descriptions
|
// It's an image rendering test doesn't need to have descriptions
|
||||||
"RoomAvatarImage_Previews-0": [.auditType(.sufficientElementDescription)]
|
"RoomAvatarImage_Previews-0": [.auditType(.sufficientElementDescription)],
|
||||||
|
// Empty container slots of the principal search toolbar, system chrome with nothing to describe
|
||||||
|
"SearchScreen_Previews-Empty": [.emptyContainerDescription],
|
||||||
|
"SearchScreen_Previews-No results": [.emptyContainerDescription],
|
||||||
|
"SearchScreen_Previews-Loaded": [.emptyContainerDescription]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,9 +121,12 @@ private enum FilterType {
|
|||||||
case compactDescription(String)
|
case compactDescription(String)
|
||||||
/// Filter by the type of the issue
|
/// Filter by the type of the issue
|
||||||
case auditType(XCUIAccessibilityAuditType)
|
case auditType(XCUIAccessibilityAuditType)
|
||||||
|
/// Filter "no description" issues on empty container elements (label + identifier empty), e.g. system toolbar slots
|
||||||
|
case emptyContainerDescription
|
||||||
}
|
}
|
||||||
|
|
||||||
private extension Array where Element == FilterType {
|
private extension Array where Element == FilterType {
|
||||||
|
@MainActor
|
||||||
func isAccessibilityIssueFiltered(_ issue: XCUIAccessibilityAuditIssue) -> Bool {
|
func isAccessibilityIssueFiltered(_ issue: XCUIAccessibilityAuditIssue) -> Bool {
|
||||||
for filter in self {
|
for filter in self {
|
||||||
switch filter {
|
switch filter {
|
||||||
@@ -127,6 +134,14 @@ private extension Array where Element == FilterType {
|
|||||||
return true
|
return true
|
||||||
case .compactDescription(issue.compactDescription):
|
case .compactDescription(issue.compactDescription):
|
||||||
return true
|
return true
|
||||||
|
case .emptyContainerDescription:
|
||||||
|
if issue.auditType == .sufficientElementDescription,
|
||||||
|
let element = issue.element,
|
||||||
|
element.elementType == .other,
|
||||||
|
element.label.isEmpty,
|
||||||
|
element.identifier.isEmpty {
|
||||||
|
return true
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user