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: Adds expected text for toContainHTML checks that fail (#299) #318

Merged
merged 4 commits into from Dec 30, 2020

Conversation

kiranjd
Copy link
Contributor

@kiranjd kiranjd commented Dec 19, 2020

What:
No expected message when tests fail when toContainHTML matcher is used

Why:
Fixes #299

How:
Added an expected block with htmlText as the expected string with 'Expected' colour using utils.EXPECTED_COLOR

Checklist:

  • Documentation N/A
  • Tests
  • Updated Type Definitions N/A
  • Ready to be merged

@codecov
Copy link

codecov bot commented Dec 19, 2020

Codecov Report

Merging #318 (b671eff) into master (4179117) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #318   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines          534       534           
  Branches       197       197           
=========================================
  Hits           534       534           
Impacted Files Coverage Δ
src/to-contain-html.js 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 4179117...b671eff. Read the comment docs.

@nickmccurdy
Copy link
Member

Can you add a regression test for this please?

@kiranjd
Copy link
Contributor Author

kiranjd commented Dec 22, 2020

@nickmccurdy Definitely. Can you point me where I can find a similar test added? Do not know what a regression test is.

EDIT: Figured out what you mean. Although I'm having trouble asserting the return value of a matcher. I think this is not possible on to-contain-html.js tests

@kiranjd
Copy link
Contributor Author

kiranjd commented Dec 23, 2020

@nickmccurdy added the regression tests

src/__tests__/to-contain-html.js Outdated Show resolved Hide resolved
@kiranjd kiranjd requested a review from gnapse December 29, 2020 16:02
@gnapse gnapse changed the title fix: Adds expected text for tests that fail (#299) fix: Adds expected text for toContainHTML checks that fail (#299) Dec 30, 2020
@gnapse gnapse merged commit 0bd1ed9 into testing-library:master Dec 30, 2020
@github-actions
Copy link

🎉 This PR is included in version 5.11.8 🎉

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.

toContainHTML no explanation for error message
3 participants