aryella-lacerda / react-native-accessibility-engine

Make accessibility-related assertions on React Native code using React Test Renderer
MIT License
163 stars 13 forks source link

feat: enable configurable options for toBeAccessible #309

Closed emilyseibert closed 1 year ago

emilyseibert commented 1 year ago

This is the solution for the proposal described in this issue: https://github.com/aryella-lacerda/react-native-accessibility-engine/issues/310

codecov[bot] commented 1 year ago

Codecov Report

Base: 99.45% // Head: 99.49% // Increases project coverage by +0.03% :tada:

Coverage data is based on head (eb9b0e5) compared to base (43be61c). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #309 +/- ## ========================================== + Coverage 99.45% 99.49% +0.03% ========================================== Files 28 31 +3 Lines 183 197 +14 Branches 43 47 +4 ========================================== + Hits 182 196 +14 Misses 1 1 ``` | [Impacted Files](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda) | Coverage Δ | | |---|---|---| | [src/\_\_tests\_\_/assets/checkbox\_512px.png](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL19fdGVzdHNfXy9hc3NldHMvY2hlY2tib3hfNTEycHgucG5n) | `100.00% <ø> (ø)` | | | [src/rules/index.ts](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL3J1bGVzL2luZGV4LnRz) | `100.00% <ø> (ø)` | | | [src/engine/index.tsx](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL2VuZ2luZS9pbmRleC50c3g=) | `100.00% <100.00%> (ø)` | | | [src/helpers/isCheckbox/isCheckbox.ts](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL2hlbHBlcnMvaXNDaGVja2JveC9pc0NoZWNrYm94LnRz) | `100.00% <100.00%> (ø)` | | | [src/matchers/toBeAccessible.ts](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL21hdGNoZXJzL3RvQmVBY2Nlc3NpYmxlLnRz) | `100.00% <100.00%> (ø)` | | | [src/rules/checked-state-required/index.ts](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL3J1bGVzL2NoZWNrZWQtc3RhdGUtcmVxdWlyZWQvaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | | | [src/rules/pressable-role-required/index.ts](https://codecov.io/gh/aryella-lacerda/react-native-accessibility-engine/pull/309/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda#diff-c3JjL3J1bGVzL3ByZXNzYWJsZS1yb2xlLXJlcXVpcmVkL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Aryella+Lacerda)

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

aryella-lacerda commented 1 year ago

@emilyseibert Can you fix the merge conflicts? I'll merge into main after.

emilyseibert commented 1 year ago

@aryella-lacerda I believe I've fixed it in my latest commit. I removed the dead code, since TS enforces rule ids via types there'd be no 'undefined' rule. I'm not sure how to retrigger Codecov to confirm it passes. The PR is up to date with main.

aryella-lacerda commented 1 year ago

Just released version v3.2.0! I noticed you added a Breaking Change warning to one of the commits, but I don't believe any of these adjustments are really breaking changes. 🤔 We can pass options to the matcher now but the lib won't break for users who don't.

emilyseibert commented 1 year ago

I don't see which commit you're referring to. I marked a few as 'feat' since it's a new capability, but I agree that nothing is breaking. Thanks for releasing!