Skip to content

Commit

Permalink
Update wpt.test.js (#70)
Browse files Browse the repository at this point in the history
Fix #67
  • Loading branch information
asamuzaK authored May 4, 2024
1 parent 95e7c2b commit 7024bdd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/wpt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,38 @@ describe('local wpt test cases', () => {
}
});

describe('css/css-scoping/host-defined.html', () => {
it('should match', () => {
const node = document.createElement('div');
node.id = 'host';
document.body.appendChild(node);
const root = node.attachShadow({ mode: 'open' });
root.innerHTML = '<div></div>';
const res = root.firstElementChild.matches(':host > div');
assert.isTrue(res, 'result');
});

it('should match', () => {
const node = document.createElement('div');
node.id = 'host';
document.body.appendChild(node);
const root = node.attachShadow({ mode: 'open' });
root.innerHTML = '<div></div>';
const res = root.firstElementChild.matches(':not(:defined) > div');
assert.isTrue(res, 'result');
});

it('should not match', () => {
const node = document.createElement('div');
node.id = 'host';
document.body.appendChild(node);
const root = node.attachShadow({ mode: 'open' });
root.innerHTML = '<div></div>';
const res = root.firstElementChild.matches(':defined > div');
assert.isFalse(res, 'result');
});
});

describe('css/css-scoping/host-dom-001.html', () => {
it('should not match', () => {
const node = document.createElement('div');
Expand Down

0 comments on commit 7024bdd

Please sign in to comment.