Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

fix matches to account for empty strings #87

Merged
merged 1 commit into from
Dec 4, 2019

Conversation

mcgloneleviROOT
Copy link
Contributor

What:

The specific issue I am trying to fix via this PR is here:

#86

Basically, the *DisplayValue queries do not work with empty strings. This fixes the matches file so that we can match empty strings.

Why:

I think these changes are necessary to match empty text fields.

How:

I verified that this fixed my issue locally. I ran tests after this, and they passed.

Checklist:

  • Documentation added to the
    docs site N/A
  • Typescript definitions updated N/A
  • Tests (I ran them locally and they worked. I can add additional test cases if deemed necessary.)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Dec 4, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #87   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          20     20           
  Lines         268    268           
  Branches       67     67           
=====================================
  Hits          268    268
Impacted Files Coverage Δ
src/lib/matches.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 251c07d...2be7283. Read the comment docs.

Copy link
Collaborator

@TAGraves TAGraves left a comment

Choose a reason for hiding this comment

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

This looks good to me. That conditional was added just for the case where textToMatch is a string. We could do some more sophisticated type checking here, but your solution seems sufficient.

Copy link
Collaborator

@bcarroll22 bcarroll22 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

Looks like you’re already in the contributors table 💯

@bcarroll22 bcarroll22 merged commit 1820077 into testing-library:master Dec 4, 2019
@bcarroll22
Copy link
Collaborator

🎉 This PR is included in version 5.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants