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

Add toHaveDescription() #244

Merged
merged 2 commits into from
May 7, 2020

Conversation

RoyalIcing
Copy link
Contributor

@RoyalIcing RoyalIcing commented May 7, 2020

What:

Adds toHaveDescription() matcher

Why:

We are able to test labels and accessible names. Almost as popular are descriptions, specified by the aria-describedby attribute. It would be great to test these as they often complement labels.

How:

  • Add toHaveDescription matcher with tests

Checklist:

  • Documentation
  • Tests
  • Updated Type Definitions
  • Ready to be merged

I will need help on how to update the type definitions. But I am happy to do so! I know TypeScript well, I’m just not sure how to update the DefinitelyTyped mega repo — do you just pull down the whole thing and make a PR there?

@codecov
Copy link

codecov bot commented May 7, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #244   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        21    +1     
  Lines          268       281   +13     
  Branches        65        68    +3     
=========================================
+ Hits           268       281   +13     
Impacted Files Coverage Δ
src/to-have-description.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 2afc2c5...d30c006. Read the comment docs.

Copy link
Member

@gnapse gnapse left a comment

Choose a reason for hiding this comment

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

Wow, nice. Did not expect this, since there was no feature request before hand, but I can't see why not.

Very thorough implementations and tests. Covers everything that could be expected. Very well documented everything in the README as well.

@gnapse gnapse requested a review from a team May 7, 2020 18:10
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.

Didn't look at the implementation or tests, but I'm definitely a fan of having this! 👍

@gnapse gnapse mentioned this pull request May 7, 2020
4 tasks
@gnapse gnapse merged commit 943a0c9 into testing-library:master May 7, 2020
@gnapse
Copy link
Member

gnapse commented May 7, 2020

🎉 This PR is included in version 5.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gnapse gnapse added the released label May 7, 2020
@gnapse
Copy link
Member

gnapse commented May 7, 2020

@all-contributors add @BurntCaramel for code, test, docs

@allcontributors
Copy link
Contributor

@gnapse

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

@RoyalIcing RoyalIcing deleted the add-to-have-description branch May 8, 2020 02:26
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.

3 participants