Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add typedefs for queries #1175

Merged
merged 1 commit into from Oct 18, 2022
Merged

docs: add typedefs for queries #1175

merged 1 commit into from Oct 18, 2022

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Oct 15, 2022

Summary

Improve documentation by adding expanded type definitions for all queries. This should make our query docs easier to understand. In line with DTL docs, I provided only typedef for getBy variant.

Test plan

None.

Copy link
Collaborator

@pierrezimmermannbam pierrezimmermannbam left a comment

Choose a reason for hiding this comment

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

Great improvement !

}
): ReactTestInstance;
```

Returns a `ReactTestInstance` with matching text – may be a string or regular expression.

This method will join `<Text>` siblings to find matches, similarly to [how React Native handles these components](https://reactnative.dev/docs/text#containers). This will allow for querying for strings that will be visually rendered together, but may be semantically separate React components.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not related to this pr but isn't this false now ? If I'm correct byText queries do not match text rendered in several components

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you are right, we should revisit our *ByText handling in a separate issue/PR, as there are some things worth discussing, e.g. should we match text spread between different child Text instance, compat with Jest Native, compat with RTL behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants