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

Weird output when satisfying an string against an element #294

Closed
sunesimonsen opened this issue Oct 25, 2019 · 3 comments · Fixed by #295
Closed

Weird output when satisfying an string against an element #294

sunesimonsen opened this issue Oct 25, 2019 · 3 comments · Fixed by #295
Labels

Comments

@sunesimonsen
Copy link
Member

Screenshot 2019-10-25 at 10 39 18

@alexjeffburke
Copy link
Member

@sunesimonsen what would you say should happen here?

@papandreou
Copy link
Member

I cannot reproduce with:

const document = new jsdom.JSDOM(
  '<body><div data-test-id="insertReusableContentModalBlockList" class="blockList"><div class="searchFailure" data-test-id="search-failure">The search failed. Please try again.</div></div></body>'
).window.document;
expect(document.body.firstChild, 'to satisfy', '<div></div>');

element_satisfy_string_diff

Could you share your assertion?

@papandreou
Copy link
Member

Ah, it's when there's a text node somewhere an element with children was expected:

const document = new jsdom.JSDOM('<div>foo</div>').window.document;
return expect(
  document.body.firstChild,
  'to satisfy',
  '<div><div><div>bar</div></div></div>'
);

text_node_satisfied_against_element

papandreou added a commit that referenced this issue Oct 26, 2019
Improves the output in a number of cases and fixes #294
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 a pull request may close this issue.

3 participants