mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
element.matches() tests added
This commit is contained in:
@@ -388,4 +388,17 @@ suite('Element', function() {
|
||||
assert.instanceOf(abb, HTMLElement);
|
||||
assert.equal(abb, sbb);
|
||||
});
|
||||
|
||||
test('matches', function() {
|
||||
var div = document.createElement('div');
|
||||
div.classList.add('host-class');
|
||||
document.body.appendChild(div);
|
||||
var p = document.createElement('p');
|
||||
p.classList.add('child-class');
|
||||
div.appendChild(p);
|
||||
assert.isTrue(p.matches(':host(.host-class) *'));
|
||||
assert.isTrue(p.matches(':host::shadow .child-class'));
|
||||
assert.isTrue(p.matches('.host-class /deep/ p.child-class'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user