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

feat(findBy*): adds findBy* query type allowing for async element queries #224

Merged
merged 3 commits into from
Mar 19, 2019

Conversation

kentcdodds
Copy link
Member

What: add findBy* query type

Why: Closes #203

How: Created a simple makeFinder function and made a finder for every query type based on the getBy queries

Checklist:

  • Documentation added to the docs site
  • Typescript definitions updated
  • Tests
  • Ready to be merged (we can add TS and docs later I think).
  • Added myself to contributors table

@alexkrolick alexkrolick requested review from alexwendte and alexkrolick and removed request for alexwendte March 19, 2019 19:50
@@ -32,6 +32,7 @@ function getElementError(message, container) {
function firstResultOrNull(queryFunction, ...args) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be renamed to something like "onlyResultOrNull" since it is more strict that the length has to be 1 now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, I didn't mean to change that yet 😬

@codecov
Copy link

codecov bot commented Mar 19, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #224   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          13     13           
  Lines         274    293   +19     
  Branches       68     68           
=====================================
+ Hits          274    293   +19
Impacted Files Coverage Δ
src/queries.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 4427c85...4177f68. Read the comment docs.

@kentcdodds
Copy link
Member Author

@all-contributors please add @alecook for review and doc

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @alecook! 🎉

@alexkrolick
Copy link
Collaborator

Sweet

@kentcdodds kentcdodds merged commit 8b29d43 into master Mar 19, 2019
@kentcdodds kentcdodds deleted the pr/find-queries branch March 19, 2019 20:46
@kentcdodds
Copy link
Member Author

I'm working on docs now.

@kentcdodds
Copy link
Member Author

🎉 This PR is included in version 3.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

kentcdodds pushed a commit to testing-library/testing-library-docs that referenced this pull request Mar 19, 2019
superT999 added a commit to superT999/testing-library-docs that referenced this pull request Feb 13, 2023
web3gru pushed a commit to web3gru/testing-library-docs that referenced this pull request May 13, 2023
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