chore: cleanup tests#10016
Conversation
|
WalkthroughThis pull request restructures accessibility (a11y) linting test fixtures across multiple rules. The changes consolidate disparate test files into standardised Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inJsx.jsx (1)
1-11: Consider pinningtype="submit"andtype="reset"in the paired valid fixture.Now that cases are split cleanly, adding explicit valid enum cases in
crates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/inJsx.jsxwould protect against regressions in accepted button types.Suggested fixture addition
/* should not generate diagnostics */ <> <button type="button">do something</button> + <button type="submit">submit form</button> + <button type="reset">reset form</button> <button type={dynamic_value}>do something</button> <button type="button"/> + <button type="submit"/> + <button type="reset"/> <button type={dynamic_value}/> <button {...props}></button> </>Based on learnings: "All code changes MUST include appropriate tests: lint rules require snapshot tests in
tests/specs/{group}/{rule}/."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inJsx.jsx` around lines 1 - 11, Add explicit valid cases for the allowed button type enums by updating the paired valid fixture for the useButtonType rule: add <button type="submit">...</button> and <button type="reset">...</button> (and their self-closing variants if present) into the valid inJsx.jsx fixture for the a11y/useButtonType tests, then run/update the snapshots so the tests include these pinned enum cases to prevent regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inJsx.jsx`:
- Around line 1-11: Add explicit valid cases for the allowed button type enums
by updating the paired valid fixture for the useButtonType rule: add <button
type="submit">...</button> and <button type="reset">...</button> (and their
self-closing variants if present) into the valid inJsx.jsx fixture for the
a11y/useButtonType tests, then run/update the snapshots so the tests include
these pinned enum cases to prevent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ef8c617d-e4e1-46f5-a2c2-a130b16d0132
⛔ Files ignored due to path filters (70)
crates/biome_js_analyze/tests/specs/a11y/noAccessKey/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noAriaHiddenOnFocusable/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noAriaUnsupportedElements/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noAriaUnsupportedElements/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noAutofocus/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noAutofocus/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noDistractingElements/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noHeaderScope/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalidCustomInputComponents.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalidCustomOptions.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noNoninteractiveElementInteractions/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noNoninteractiveElementToInteractiveRole/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noNoninteractiveTabindex/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noPositiveTabindex/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noPositiveTabindex/reactCreateElementInvalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noRedundantAlt/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noStaticElementInteractions/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noSvgWithoutTitle/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/noSvgWithoutTitle/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/area.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/img.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/input.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/object.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAltText/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAnchorContent/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaPropsForRole/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaPropsSupportedByRole/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useAriaPropsSupportedByRole/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inJsx.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inObject.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withBinding.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withDefaultNamespace.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withRenamedImport.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/inJsx.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/inObject.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/withBinding.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useFocusableInteractive/invalid.js.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useFocusableInteractive/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useFocusableInteractive/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useHeadingContent/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useHtmlLang/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useIframeTitle/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useIframeTitle/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useKeyWithClickEvents/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useKeyWithMouseEvents/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useMediaCaption/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useSemanticElements/valid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidAnchor/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidAriaProps/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidAriaRole/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidAriaValues/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidAutocomplete/invalid.jsx.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/a11y/useValidLang/invalid.jsx.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (76)
crates/biome_js_analyze/src/lint/a11y/use_aria_props_supported_by_role.rscrates/biome_js_analyze/tests/specs/a11y/noAccessKey/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noAriaHiddenOnFocusable/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noAriaUnsupportedElements/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noAriaUnsupportedElements/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noAutofocus/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noAutofocus/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noDistractingElements/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noHeaderScope/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noInteractiveElementToNoninteractiveRole/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/invalid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/all/valid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/invalid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/inputComponents/valid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalidCustomLabelAttributes.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/invalid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelAttributes/valid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/invalid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/labelComponents/valid.options.jsoncrates/biome_js_analyze/tests/specs/a11y/noNoninteractiveElementInteractions/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noNoninteractiveElementToInteractiveRole/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noNoninteractiveTabindex/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noPositiveTabindex/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noPositiveTabindex/reactCreateElementInvalid.jscrates/biome_js_analyze/tests/specs/a11y/noRedundantAlt/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noRedundantRoles/invalidHtmlAamRoleGeneric.jsxcrates/biome_js_analyze/tests/specs/a11y/noStaticElementInteractions/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noSvgWithoutTitle/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/noSvgWithoutTitle/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/area.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/img.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/input.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/object.jsxcrates/biome_js_analyze/tests/specs/a11y/useAltText/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAnchorContent/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.jscrates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAriaPropsForRole/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAriaPropsSupportedByRole/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useAriaPropsSupportedByRole/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inJsx.jsxcrates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/inObject.jscrates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withBinding.jscrates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withDefaultNamespace.jscrates/biome_js_analyze/tests/specs/a11y/useButtonType/invalid/withRenamedImport.jscrates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/inJsx.jsxcrates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/inObject.jscrates/biome_js_analyze/tests/specs/a11y/useButtonType/valid/withBinding.jscrates/biome_js_analyze/tests/specs/a11y/useFocusableInteractive/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useFocusableInteractive/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useHeadingContent/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useHtmlLang/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useIframeTitle/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useIframeTitle/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useKeyWithClickEvents/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useKeyWithMouseEvents/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useMediaCaption/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useSemanticElements/valid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidAnchor/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidAriaProps/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidAriaRole/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidAriaValues/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidAutocomplete/invalid.jsxcrates/biome_js_analyze/tests/specs/a11y/useValidLang/invalid.jsx
💤 Files with no reviewable changes (9)
- crates/biome_js_analyze/tests/specs/a11y/noSvgWithoutTitle/valid.jsx
- crates/biome_js_analyze/tests/specs/a11y/noLabelWithoutControl/invalidCustomLabelAttributes.jsx
- crates/biome_js_analyze/tests/specs/a11y/useAltText/area.jsx
- crates/biome_js_analyze/tests/specs/a11y/noAriaUnsupportedElements/valid.jsx
- crates/biome_js_analyze/tests/specs/a11y/useAltText/input.jsx
- crates/biome_js_analyze/tests/specs/a11y/useAltText/object.jsx
- crates/biome_js_analyze/tests/specs/a11y/useAltText/img.jsx
- crates/biome_js_analyze/tests/specs/a11y/useAriaActivedescendantWithTabindex/valid.js
- crates/biome_js_analyze/tests/specs/a11y/useIframeTitle/valid.jsx
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
There are still some parsing errors in
useAriaPropsSupportedByRole, but that snapshot should fail, which it doesn't due to some ARIA stuff. As if we follow aria 1.1 instead of 1.2, so going to fix that in another PRTest Plan
Manually checked every snapshot :(
Docs