Skip to content

Commit

Permalink
Add tests to improve coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjeffburke committed Sep 29, 2018
1 parent 8bcb39e commit a62d72a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/index.spec.js
Expand Up @@ -2039,6 +2039,15 @@ describe('unexpected-dom', function() {
});
});

it('should succeed with a node child', function() {
var node = document.createElement('div');
node.innerHTML = '<div foo="bar">hey</div>';
body.innerHTML = '<div><div foo="bar">hey</div></div>';
expect(body.firstChild, 'to satisfy', {
children: [node.firstChild]
});
});

it('should fail with a diff', function() {
body.innerHTML = '<div foo="bar">hey</div>';
expect(
Expand Down Expand Up @@ -2668,7 +2677,7 @@ describe('unexpected-dom', function() {

describe('to satisfy', function() {
describe('when comparing an array of children', function() {
it('should succeed with text child', function() {
it('should succeed with a text child', function() {
expect(
[
'<?xml version="1.0"?>',
Expand All @@ -2688,6 +2697,19 @@ describe('unexpected-dom', function() {
}
);
});

it('should succeed with a complex child', function() {
expect(
'<?xml version="1.0"?><content><hello type="greeting">World</hello></content>',
'when parsed as XML',
'queried for first',
'content',
'to satisfy',
{
children: ['<hello type="greeting">World</hello>']
}
);
});
});
});

Expand Down

0 comments on commit a62d72a

Please sign in to comment.