Skip to content

chore: deprecate some a11y queries - #1226

Merged
mdjastrzebski merged 11 commits into
mainfrom
feat/deprecate-some-a11y-queries
Jan 28, 2023
Merged

chore: deprecate some a11y queries#1226
mdjastrzebski merged 11 commits into
mainfrom
feat/deprecate-some-a11y-queries

Conversation

@mdjastrzebski

@mdjastrzebskimdjastrzebski commented Nov 15, 2022

Copy link
Copy Markdown
Member

Summary

Make *ByA11yState and *ByA11yValue queries deprecated, redirecting user to use *ByRole queries or toHaveAcessbibilityState/Value() matchers.

When doing any of the mentioned queries, user will received following warning to console:

getByA11yValue(...) is deprecated and will be removed in the future.
Use expect(...).toHaveAccessibilityValue(...) matcher o rgetByRole(role, { value: ... }) query instead.
getByAccessibilityState(...) is deprecated and will be removed in the future.
Use getByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead.

Resolves#1208

Test plan

Add tests for deprecation messages warnings.

@mdjastrzebskimdjastrzebski changed the title feat: deprecate some a11y queries[WIP] feat: deprecate some a11y queriesDec 29, 2022
@mdjastrzebski
mdjastrzebskiforce-pushed the feat/deprecate-some-a11y-queries branch from 4fae1c7 to 2078fa5CompareJanuary 27, 2023 10:55
@mdjastrzebski
mdjastrzebski requested review from AugustinLF, MattAgn and pierrezimmermannbam and removed request for AugustinLF and MattAgnJanuary 27, 2023 10:57
@mdjastrzebski
mdjastrzebski marked this pull request as ready for review January 27, 2023 10:57
@mdjastrzebskimdjastrzebski changed the title [WIP] feat: deprecate some a11y querieschore: deprecate some a11y queriesJan 27, 2023
Comment threadsrc/helpers/deprecation.ts Outdated
Comment threadsrc/helpers/deprecation.ts Outdated
Comment threadsrc/queries/a11yState.ts Outdated
},
'AccessibilityState',
'Role(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher'
'Use {queryPrefix}ByRole(role, { disabled, selected, checked, busy, expanded }) query or expect(...).toHaveAccessibilityState(...) matcher instead.'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great refactor !

@pierrezimmermannbampierrezimmermannbam left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks very good ! Great deprecation warnings and documentation

Comment threadsrc/queries/a11yState.ts Outdated
Comment threadsrc/queries/__tests__/a11yState.test.tsx Outdated
Comment threadwebsite/docs/Queries.md Outdated
Comment threadwebsite/docs/Queries.md Outdated
Comment threadsrc/queries/a11yState.ts Outdated
@codecov

codecovBot commented Jan 28, 2023

Copy link
Copy Markdown

Codecov Report

Base: 95.98% // Head: 96.04% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (7ef6445) compared to base (897b7de).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@ Coverage Diff @@## main #1226 +/- ##
==========================================
+ Coverage 95.98% 96.04% +0.06% 
==========================================
Files 47 49 +2 Lines 3240 3290 +50 Branches 489 494 +5 ==========================================
+ Hits 3110 3160 +50 
Misses 130 130 
Impacted FilesCoverage Δ
src/helpers/deprecation.ts100.00% <100.00%> (ø)
src/helpers/query-name.ts100.00% <100.00%> (ø)
src/queries/a11yState.ts100.00% <100.00%> (ø)
src/queries/a11yValue.ts100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Call for maintainers: Flow types

4 participants

@mdjastrzebski@thymikee@AugustinLF@pierrezimmermannbam