-
-
Notifications
You must be signed in to change notification settings - Fork 919
chore: add some Web Platform Tests testcases #7135
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html | ||
| <> | ||
| <b role="generic">x</b> | ||
| <bdi role="generic">x</bdi> | ||
| <bdo role="generic">x</bdo> | ||
| <data value="1" role="generic"> | ||
| x | ||
| </data> | ||
| <div open role="generic"> | ||
| x | ||
| </div> | ||
ematipico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <i role="generic">x</i> | ||
| <pre role="generic">x</pre> | ||
| <q role="generic">x</q> | ||
| <samp role="generic">x</samp> | ||
| <small role="generic">x</small> | ||
| <span role="generic">x</span> | ||
| <u role="generic">x</u> | ||
| </>; | ||
256 changes: 256 additions & 0 deletions
256
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,256 @@ | ||
| --- | ||
| source: crates/biome_js_analyze/tests/spec_tests.rs | ||
| expression: invalidHtmlAamRoleGeneric.jsx | ||
| --- | ||
| # Input | ||
| ```jsx | ||
| // https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html | ||
| <> | ||
| <b role="generic">x</b> | ||
| <bdi role="generic">x</bdi> | ||
| <bdo role="generic">x</bdo> | ||
| <data value="1" role="generic"> | ||
| x | ||
| </data> | ||
| <div open role="generic"> | ||
| x | ||
| </div> | ||
| <i role="generic">x</i> | ||
| <pre role="generic">x</pre> | ||
| <q role="generic">x</q> | ||
| <samp role="generic">x</samp> | ||
| <small role="generic">x</small> | ||
| <span role="generic">x</span> | ||
| <u role="generic">x</u> | ||
| </>; | ||
|
|
||
| ``` | ||
|
|
||
| # Diagnostics | ||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:3:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'b' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 1 │ // https://github.com/web-platform-tests/wpt/blob/master/html-aam/roles-generic.html | ||
| 2 │ <> | ||
| > 3 │ <b role="generic">x</b> | ||
| │ ^^^^^^^^^ | ||
| 4 │ <bdi role="generic">x</bdi> | ||
| 5 │ <bdo role="generic">x</bdo> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 3 │ → <b·role="generic">x</b> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:4:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'bdi' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 2 │ <> | ||
| 3 │ <b role="generic">x</b> | ||
| > 4 │ <bdi role="generic">x</bdi> | ||
| │ ^^^^^^^^^ | ||
| 5 │ <bdo role="generic">x</bdo> | ||
| 6 │ <data value="1" role="generic"> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 4 │ → <bdi·role="generic">x</bdi> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:5:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'bdo' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 3 │ <b role="generic">x</b> | ||
| 4 │ <bdi role="generic">x</bdi> | ||
| > 5 │ <bdo role="generic">x</bdo> | ||
| │ ^^^^^^^^^ | ||
| 6 │ <data value="1" role="generic"> | ||
| 7 │ x | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 5 │ → <bdo·role="generic">x</bdo> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:6:23 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'data' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 4 │ <bdi role="generic">x</bdi> | ||
| 5 │ <bdo role="generic">x</bdo> | ||
| > 6 │ <data value="1" role="generic"> | ||
| │ ^^^^^^^^^ | ||
| 7 │ x | ||
| 8 │ </data> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 6 │ → <data·value="1"·role="generic"> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:9:17 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'div' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 7 │ x | ||
| 8 │ </data> | ||
| > 9 │ <div open role="generic"> | ||
| │ ^^^^^^^^^ | ||
| 10 │ x | ||
| 11 │ </div> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 9 │ → <div·open·role="generic"> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:12:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'i' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 10 │ x | ||
| 11 │ </div> | ||
| > 12 │ <i role="generic">x</i> | ||
| │ ^^^^^^^^^ | ||
| 13 │ <pre role="generic">x</pre> | ||
| 14 │ <q role="generic">x</q> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 12 │ → <i·role="generic">x</i> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:13:12 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'pre' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 11 │ </div> | ||
| 12 │ <i role="generic">x</i> | ||
| > 13 │ <pre role="generic">x</pre> | ||
| │ ^^^^^^^^^ | ||
| 14 │ <q role="generic">x</q> | ||
| 15 │ <samp role="generic">x</samp> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 13 │ → <pre·role="generic">x</pre> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:14:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'q' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 12 │ <i role="generic">x</i> | ||
| 13 │ <pre role="generic">x</pre> | ||
| > 14 │ <q role="generic">x</q> | ||
| │ ^^^^^^^^^ | ||
| 15 │ <samp role="generic">x</samp> | ||
| 16 │ <small role="generic">x</small> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 14 │ → <q·role="generic">x</q> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:15:13 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'samp' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 13 │ <pre role="generic">x</pre> | ||
| 14 │ <q role="generic">x</q> | ||
| > 15 │ <samp role="generic">x</samp> | ||
| │ ^^^^^^^^^ | ||
| 16 │ <small role="generic">x</small> | ||
| 17 │ <span role="generic">x</span> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 15 │ → <samp·role="generic">x</samp> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:16:14 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'small' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 14 │ <q role="generic">x</q> | ||
| 15 │ <samp role="generic">x</samp> | ||
| > 16 │ <small role="generic">x</small> | ||
| │ ^^^^^^^^^ | ||
| 17 │ <span role="generic">x</span> | ||
| 18 │ <u role="generic">x</u> | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 16 │ → <small·role="generic">x</small> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:17:13 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'span' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 15 │ <samp role="generic">x</samp> | ||
| 16 │ <small role="generic">x</small> | ||
| > 17 │ <span role="generic">x</span> | ||
| │ ^^^^^^^^^ | ||
| 18 │ <u role="generic">x</u> | ||
| 19 │ </>; | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 17 │ → <span·role="generic">x</span> | ||
| │ -------------- | ||
|
|
||
| ``` | ||
|
|
||
| ``` | ||
| invalidHtmlAamRoleGeneric.jsx:18:10 lint/a11y/noRedundantRoles FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
|
|
||
| × Using the role attribute 'generic' on the 'u' element is redundant, because it is implied by its semantic. | ||
|
|
||
| 16 │ <small role="generic">x</small> | ||
| 17 │ <span role="generic">x</span> | ||
| > 18 │ <u role="generic">x</u> | ||
| │ ^^^^^^^^^ | ||
| 19 │ </>; | ||
| 20 │ | ||
|
|
||
| i Unsafe fix: Remove the role attribute. | ||
|
|
||
| 18 │ → <u·role="generic">x</u> | ||
| │ -------------- | ||
|
|
||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should put imported tests into their own folder.