Skip to content

toContainHTML no explanation for error message #299

Closed
@RowinVanAmsterdam

Description

@RowinVanAmsterdam

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")

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreleased

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions