From f96a232f595e55a1a725ad47ce6798fd8a592e0b Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Sat, 24 Jan 2015 10:30:38 +0100 Subject: [PATCH] `element.matches()` tests added --- tests/ShadowDOM/js/Element.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/ShadowDOM/js/Element.js b/tests/ShadowDOM/js/Element.js index a7b4a21..f7eaf49 100644 --- a/tests/ShadowDOM/js/Element.js +++ b/tests/ShadowDOM/js/Element.js @@ -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')); + }); + });