Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix test on secondary requirements #2102

Merged
merged 3 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions __tests__/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ function validateRuleFrontmatter({ frontmatter }, metaData) {
*/
const accRequirementValues = Object.values(accessibility_requirements)
test.each(accRequirementValues)('has expected keys for accessibility requirement: `%p`', accReq => {
if (!accReq) {
return
} else if (accReq.secondary) {
// Note; empty strings & false won't get here, and so aren't allowed
expect(['string', 'boolean']).toContain(typeof accReq.secondary)
return
}

expect(accReq).not.toBeNull()
expect(typeof accReq).toBe('object')
const keys = Object.keys(accReq).sort()
expect(keys.length).toBeGreaterThanOrEqual(4)
expect(keys).toIncludeAllMembers(['failed', 'forConformance', 'inapplicable', 'passed'])

if (keys.includes('secondary')) {
expect(keys.length).toBe(1)
expect(typeof accReq.secondary).toBe('string')
} else {
expect(keys.length).toBeGreaterThanOrEqual(4)
expect(keys).toIncludeAllMembers(['failed', 'forConformance', 'inapplicable', 'passed'])
}
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions _rules/aria-required-id-references-in6db8.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ accessibility_requirements:
passed: satisfied
inapplicable: satisfied
wcag20:1.3.1: # Info and Relationships (A)
secondary: true
secondary: This success criterion is **less strict** than this rule. This is because the rule does not check for alternatives which may be accessible. Some of the failed examples satisfy this success criterion.
wcag20:4.1.2: # Name, Role, Value (A)
secondary: true
secondary: This success criterion is **less strict** than this rule. This is because the rule does not check for alternatives which may be accessible. Some of the failed examples satisfy this success criterion.
input_aspects:
- DOM Tree
- CSS Styling
Expand All @@ -32,7 +32,7 @@ This rule applies to any `aria-controls` attribute defined on an [HTML element][

## Expectation

Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [shadow tree][] or, if not within a [shadow tree][], within the same [document][document tree]
Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [shadow tree][] or, if not within a [shadow tree][], within the same [document][document tree]
WilcoFiers marked this conversation as resolved.
Show resolved Hide resolved

## Assumptions

Expand Down
2 changes: 1 addition & 1 deletion _rules/text-contrast-afw4f7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ accessibility_requirements:
passed: further testing needed
inapplicable: further testing needed
wcag20:1.4.6: # Contrast (Enhanced) (AAA)
secondary: This success criterion is **more strict** than this rule. This is because this criterion has a higher minimum contrast. Some of the passed examples do not satisfy this success criterion.
secondary: This success criterion is **more strict** than this rule. This is because this criterion has a higher minimum contrast. Some of the passed examples do not satisfy this success criterion.
input_aspects:
- Accessibility Tree
- DOM Tree
Expand Down