Skip to content

refactor: export label helpers to his own file and use both in suggestions and query#790

Merged
kentcdodds merged 4 commits into
testing-library:masterfrom
marcosvega91:pr/refactor_suggestion
Oct 20, 2020
Merged

refactor: export label helpers to his own file and use both in suggestions and query#790
kentcdodds merged 4 commits into
testing-library:masterfrom
marcosvega91:pr/refactor_suggestion

Conversation

@marcosvega91

Copy link
Copy Markdown
Member

What: Moved label helpers to his own file

Why: suggestions was using his logic to get label content that was not working with aria-labelledby

How: Using the logic implemented by @delca85 both for suggestions and label query

Checklist:

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

@codesandbox-ci

codesandbox-ci Bot commented Oct 16, 2020

Copy link
Copy Markdown

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 08d619a:

Sandbox Source
kentcdodds/react-testing-library-examples Configuration

@codecov

codecov Bot commented Oct 16, 2020

Copy link
Copy Markdown

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #790   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        26    +1     
  Lines          724       719    -5     
  Branches       190       184    -6     
=========================================
- Hits           724       719    -5     
Impacted Files Coverage Δ
src/label-helpers.js 100.00% <100.00%> (ø)
src/queries/label-text.js 100.00% <100.00%> (ø)
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 a386d87...08d619a. Read the comment docs.

@kentcdodds kentcdodds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks pretty good. Just one thing.

Comment thread src/suggestions.js
kentcdodds
kentcdodds previously approved these changes Oct 16, 2020

@kentcdodds kentcdodds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, I think it looks good to me. I'd love another reviewer here though. @delca85?

@delca85

delca85 commented Oct 16, 2020

Copy link
Copy Markdown
Member

Ok, I think it looks good to me. I'd love another reviewer here though. @delca85?

I will be happy to review it but I am going to look at it in a couple of hours, ok?

@marcosvega91

Copy link
Copy Markdown
Member Author

Is not a problem ☺️ thanks for the help @delca85

Comment thread src/label-helpers.js Outdated
delca85
delca85 previously approved these changes Oct 16, 2020
@delca85

delca85 commented Oct 16, 2020

Copy link
Copy Markdown
Member

I approved this one. I think using the same logic in both suggestion and get labels logic is really a good idea! As well as fixing the suggestion defect related to label concatenation, for sure.

@kentcdodds

Copy link
Copy Markdown
Member

Looks like @marcosvega91's other PR made a conflict with this one. Could you get that fixed @marcosvega91? Thanks!

@marcosvega91

Copy link
Copy Markdown
Member Author

I have rebased the branch 👍 :)

@marcosvega91
marcosvega91 force-pushed the pr/refactor_suggestion branch from 5c74abf to 08d619a Compare October 20, 2020 10:30

@kentcdodds kentcdodds left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent. Thank you!

@kentcdodds
kentcdodds merged commit 626f847 into testing-library:master Oct 20, 2020
@marcosvega91
marcosvega91 deleted the pr/refactor_suggestion branch October 20, 2020 16:38
@testing-library-bot

Copy link
Copy Markdown

🎉 This PR is included in version 7.26.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants