element.matches() tests added

This commit is contained in:
Nazar Mokrynskyi
2015-01-24 10:30:38 +01:00
parent 215806a2a7
commit f96a232f59

View File

@@ -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'));
});
});