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

toContainHTML no explanation for error message #299

Closed
RowinVanAmsterdam opened this issue Oct 14, 2020 · 3 comments · Fixed by #318
Closed

toContainHTML no explanation for error message #299

RowinVanAmsterdam opened this issue Oct 14, 2020 · 3 comments · Fixed by #318
Assignees
Labels
bug Something isn't working released

Comments

@RowinVanAmsterdam
Copy link

After receiving HTML from a function, toContainHTML will throw an error without any explanation. No 'expected', terminal will only show what it received.

Jest test:
expect(getElement('paragraph', 'footer')).toContainHTML('<p class="paragraph second-paragraph" id="id7">this is the second paragraph of footer</p>');

Terminal log:
Received: <p class="paragraph second-paragraph" id="id7">this is the second paragraph of footer</p>

If I use toContainElement, it will throw an error that it receives a string and not an HTML element.

The getElement function will return the HTML element as soon as they find a match with the classes ("class="paragraph second-paragraph")

@nickmccurdy nickmccurdy added the bug Something isn't working label Oct 21, 2020
@kiranjd
Copy link
Contributor

kiranjd commented Dec 18, 2020

I would like to work on this

@gnapse
Copy link
Member

gnapse commented Dec 18, 2020

@kiranjd thanks, you are very welcome. Go for it!

@github-actions
Copy link

🎉 This issue has been resolved 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
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants