Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Aug 6, 2025

Summary

Read #7128 for more context. But the Web Platform Tests have hundreds of test cases that could be brought into Biome to capture nuanced browser behavior when it comes to ARIA role calculation. It really shines with edge cases, and highlights all the ways Biome would deviate from browser behavior.

This PR doesn’t introduce any changes! It only adds more test-cases. Looking for feedback on where these live, because there’ll be a lot more of these 🙏

Alternatives

What we’re really doing is calculating roles, which there aren’t unit tests for. Rather than using noRedundantRoles’ tests, we could do something lower-level if there ends up being too much indirection here

Test Plan

  • Tests added

Docs

Just tests?

@changeset-bot
Copy link

changeset-bot bot commented Aug 6, 2025

⚠️ No Changeset found

Latest commit: 68d2374

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 6, 2025

Walkthrough

A new test file invalidHtmlAamRoleGeneric.jsx was added to the accessibility analysis tests. It includes a JSX fragment where multiple HTML elements are assigned the ARIA role generic. The test covers elements like <b>, <div>, <span>, and others, aiming to verify detection of redundant or invalid generic role usage. No changes were made to exported or public entities; this is purely a new set of test cases for accessibility role validation.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc3f41d and 68d2374.

⛔ Files ignored due to path filters (2)
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Aug 6, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx (1)

1-19: Consider test organisation for future WPT additions.

Given the PR objectives mention many more WPT test cases will be added, consider creating a consistent naming pattern like wpt_html_aam_roles_generic.jsx to make future WPT-sourced tests easily identifiable.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f739e1 and cc3f41d.

⛔ Files ignored due to path filters (2)
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snap is excluded by !**/*.snap
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
crates/biome_*/**/*

📄 CodeRabbit Inference Engine (CLAUDE.md)

Core crates must be located in /crates/biome_*/

Files:

  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:18.454Z
Learning: You are encouraged to split the work for a new rule into multiple PRs and describe your plan in an issue if unfamiliar with Biome's APIs.
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:51:59.193Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Add end-to-end tests for watcher functionality in LSP tests (../biome_lsp/src/server.tests.rs)
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.
📚 Learning: applies to crates/biome_formatter/tests/specs/html/**/*.html : create your first `.html` test file i...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/specs/html/**/*.html : Create your first `.html` test file inside `tests/specs/html`, preferably organizing tests into subfolders by kind.

Applied to files:

  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
📚 Learning: applies to crates/biome_formatter/tests/spec_tests.rs : update the `spec_tests.rs` file to generate ...
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:56.365Z
Learning: Applies to crates/biome_formatter/tests/spec_tests.rs : Update the `spec_tests.rs` file to generate a test function for each `.html` file found inside `tests/specs/html` using the `tests_macros::gen_tests!` macro.

Applied to files:

  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
📚 Learning: see the documentation of `packages/aria-data` to generate this file....
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_aria_metadata/CONTRIBUTING.md:0-0
Timestamp: 2025-08-05T14:50:25.072Z
Learning: See the documentation of `packages/aria-data` to generate this file.

Applied to files:

  • crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: End-to-end tests
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix
  • GitHub Check: Test Node.js API
🔇 Additional comments (2)
crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx (2)

1-1: Excellent WPT integration reference.

Good practice referencing the original WPT source for traceability.


2-19: Comprehensive test coverage for generic role redundancy.

The test cases effectively cover various HTML elements where role="generic" would be redundant, which aligns perfectly with the noRedundantRoles rule testing.

@drwpow drwpow changed the title chore: Add some Web Platform Tests testcases chore: add some Web Platform Tests testcases Aug 6, 2025
Copy link
Contributor

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.

@ematipico ematipico merged commit d37638d into biomejs:main Oct 15, 2025
12 of 13 checks passed
@drwpow drwpow deleted the drwpow/wpt branch October 15, 2025 14:31
@coderabbitai coderabbitai bot mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants