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

fix: canSuggest should not be case sensitive #628

Merged

Conversation

marcosvega91
Copy link
Member

What:

Following up #627 I have updated canSuggest function because it only works when methods where exactly the same.

Why:

because I think that getSuggestedQuery should return the same result for method 'Role' and method 'role'.

How:

I have compared lowecase strings.

Checklist:

  • Documentation added to the
    docs site
  • Tests
  • Typescript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2be6315:

Sandbox Source
charming-maxwell-wbydz Configuration

@codecov
Copy link

codecov bot commented Jun 13, 2020

Codecov Report

Merging #628 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #628   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          565       565           
  Branches       142       141    -1     
=========================================
  Hits           565       565           
Impacted Files Coverage Δ
src/suggestions.js 100.00% <100.00%> (ø)

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 30a1ee8...2be6315. Read the comment docs.

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

I'm good with this 👍

@kentcdodds kentcdodds merged commit d6f6d3a into testing-library:master Jun 13, 2020
@kentcdodds
Copy link
Member

@all-contributors please add @marcosvega91 for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

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

@kentcdodds
Copy link
Member

🎉 This PR is included in version 7.14.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@smeijer
Copy link
Member

smeijer commented Jun 13, 2020

I'm good with this

It's not a big deal, but how are we going to support this when adding typescript support? 😇

type method = role | Role | getByText | getbytext | ....

Seems unwanted to me.

@marcosvega91
Copy link
Member Author

But in this case you will have an error so I think that we don't need to cover both cases in the type

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

3 participants