Skip to content

feat(render): add new query capabilities for improved tests #17

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Mar 23, 2018

Conversation

kentcdodds
Copy link
Member

What: Add the following methods

  • queryByText
  • getByText
  • queryByPlaceholderText
  • getByPlaceholderText
  • queryByLabelText
  • getByLabelText

Why: Closes #16

These will really improve the usability of this module. These also align much better with the guiding principles 👍

How:

  • Created a queries.js file where we have all the logic for the queries and their associated getter functions
  • Migrate tests where it makes sense
  • Update docs considerably.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table N/A

@kentcdodds kentcdodds force-pushed the pr/improved-utilities branch from 6bed73e to 74ecfa6 Compare March 23, 2018 13:34
@codecov
Copy link

codecov bot commented Mar 23, 2018

Codecov Report

Merging #17 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #17   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      2    +1     
  Lines          10     53   +43     
  Branches        1     13   +12     
=====================================
+ Hits           10     53   +43
Impacted Files Coverage Δ
src/queries.js 100% <100%> (ø)
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eb804a...8fa8cc5. Read the comment docs.

@kentcdodds kentcdodds force-pushed the pr/improved-utilities branch from 74ecfa6 to c53b317 Compare March 23, 2018 13:39
**What**: Add the following methods

- queryByText
- getByText
- queryByPlaceholderText
- getByPlaceholderText
- queryByLabelText
- getByLabelText

**Why**: Closes #16

These will really improve the usability of this module. These also align much better with the guiding principles 👍

**How**:

- Created a `queries.js` file where we have all the logic for the queries and their associated getter functions
- Migrate tests where it makes sense
- Update docs considerably.

**Checklist**:

* [x] Documentation
* [x] Tests
* [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
* [ ] Added myself to contributors table N/A
@kentcdodds kentcdodds force-pushed the pr/improved-utilities branch from c53b317 to 8fa8cc5 Compare March 23, 2018 13:49
@kentcdodds kentcdodds merged commit 12c7ed1 into master Mar 23, 2018
@kentcdodds kentcdodds deleted the pr/improved-utilities branch March 23, 2018 13:57
@kentcdodds
Copy link
Member Author

I'm really excited about this!!

julienw pushed a commit to julienw/react-testing-library that referenced this pull request Dec 20, 2018
…his API (testing-library#18)

* Add bindQueriesToElement utility function for libraries using this API

* Add documentation and update contributors

* Rename to bindElementToQueries as this seems to be more appropriate

Closes testing-library#17
lucbpz pushed a commit to lucbpz/react-testing-library that referenced this pull request Jul 26, 2020
fix: 🐛 click() handles checkboxes correctly
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant