Skip to content

docs: add typedefs for queries - #1175

Merged
mdjastrzebski merged 1 commit into
mainfrom
docs/query-api-types
Oct 18, 2022
Merged

docs: add typedefs for queries#1175
mdjastrzebski merged 1 commit into
mainfrom
docs/query-api-types

Conversation

@mdjastrzebski

@mdjastrzebski mdjastrzebski commented Oct 15, 2022

Copy link
Copy Markdown
Member

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.

@pierrezimmermannbam pierrezimmermannbam 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.

Great improvement !

Comment thread website/docs/Queries.md

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
Copy Markdown
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
Copy Markdown
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.

2 participants