Uh oh!
There was an error while loading. Please reload this page.
feat: ...byRole type queries accepts second arg - #875
Conversation
ca7b4c7 to
ea68aa1CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…react-native-testing-library into feat/by-role-second-arg
Uh oh!
There was an error while loading. Please reload this page.
AugustinLF
commented
Mar 28, 2022
@kiranjd is it something you're still interested in getting in? This is a feature that is clearly lacking for our current API, and I'd love to help you getting that in a mergeable state. |
kiranjd
commented
Mar 28, 2022
@AugustinLF Missed following up on this. I remember I had a few questions. I'll post the questions and follow it up to finish within this week. Thank you 🙏 |
| createQueryByError, | ||
| } from './errors'; | ||
| type QueryOptions = { |
There was a problem hiding this comment.
The name in QueryOptions type for getBy is optional. But, it's a must for the function, filterWithName. Is this duplication that I get rid of or is this okay?
(I haven't worked with types all that much 😬 )
- adds tests for deprecations - change second param on findBy queries
291ebcc to
a5f168cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 'interval', | ||
| 'stackTraceError', | ||
| ]; | ||
| const warnDeprectedWaitForOptionsUsage = (queryOptions?: WaitForOptions) => { |
There was a problem hiding this comment.
| constwarnDeprectedWaitForOptionsUsage=(queryOptions?: WaitForOptions)=>{ | |
| constwarnDeprecatedWaitForOptionsUsage=(queryOptions?: WaitForOptions)=>{ |
There was a problem hiding this comment.
Also pls move it to helpers/errors.ts, as this looks like reusable function that can be used with other findByXxx queries if they decide to go with query options.
Uh oh!
There was an error while loading. Please reload this page.
AugustinLF
commented
Apr 25, 2022
@kiranjd Do you need any help, is there anything I can do to help you getting that in? :) |
| type FindReturn = Promise<GetReturn>; | ||
| type FindAllReturn = Promise<GetAllReturn>; | ||
| export type QueryOptions = { |
There was a problem hiding this comment.
This type should be renamed to ByRoleOptions bacause this type of option is only relevant to byRole queries.
| isNodeValid(node) && matcherFn(node.props[name], matcher); | ||
| return ( | ||
| matchesRole && !!getQueriesForElement(node).queryByText(options.name) |
There was a problem hiding this comment.
it looks like we should match for either queryByText(options.name) or queryByLabelText(options.name)
| matcherFn: (prop: P, value: M) => boolean | ||
| ) => (instance: ReactTestInstance) => { | ||
| const getBy = (matcher: M) => { | ||
| const filterWithName = ( |
There was a problem hiding this comment.
Suggested name filterByAccessibilityName
mdjastrzebski
commented
May 4, 2022
Let's pause this PR for couple of days till we get a11y query reorganisation from #325 done. This should allow for easy separate query options type per each query, so that the |
kiranjd
commented
May 5, 2022
via email
Yes, those changes caused lot of conflicts On Wed, 4 May 2022 at 3:58 PM, Maciej Jastrzebski ***@***.***> wrote:
Let's pause this PR for couple of days till we get a11y query
reorganisation from #325
<#325>
done. This should allow for easy separate query options type per each
query, so that the name options will be allowed only for byRole queries
and not all a11y queries.
—
Reply to this email directly, view it on GitHub
<#875 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGFANA3PQMXZBXCJ744WUCDVIJGMTANCNFSM5JHKFNKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
-- Kiran JD |
kiranjd
commented
Jul 25, 2022
@mdjastrzebski is this a good time to take this PR further? If so, should I raise a separate PR to continue the work? |
AugustinLF
commented
Jul 28, 2022
@kiranjd I feel like yes we should be able to start working on that once again. I'd however wait for the go from @mdjastrzebski who might have something else planned before that. Nonetheless, feel free to let me know if you need any help on that, I'm very keen in getting this one in. |
mdjastrzebski
commented
Aug 1, 2022
@kiranjd go ahead 👍🏻 Now is the right time to work on this PR, as we've got a11y properly refactored. |
@kiranjd is there anything we can do to help you to get that in? It'd bring so much value, I'm really looking to get that one in <3 |
kiranjd
commented
Aug 25, 2022
@AugustinLF Thanks for the support. I will work on this and hopefully get this in a mergeable state by this weekend 🤞🏻 |
AugustinLF
commented
Sep 14, 2022
@kiranjd if you're short on time to finish this PR I can definitely help fixing the last few things to get it merged, let me know if you want help :) |
kiranjd
commented
Sep 15, 2022
@AugustinLF Have tried to redo the changes from the last state when it was working. There seems to be a lot of refactoring undergone in the meanwhile. |
mdjastrzebski
commented
Sep 16, 2022
@kiranjd yeah RNTL codebase did move a lot since the original PR submission :-) @AugustinLF I would be great if you could help to move this forward, as |
mdjastrzebski
commented
Sep 22, 2022
This PR has been rebased and updated by @AugustinLF as #1127. Thank you @kiranjd 👏🏻 for the initial implementation! |
Closes#827
Summary
Test plan