Skip to content

Commit 32845c6

Browse files
Added more tests
1 parent 32a7dff commit 32845c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/patches.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ requirejs(['requirejs-sandbox', 'requirejs-sandbox/helpers/patch'], function(req
9393
equal(element.find('> ul').length, 1, 'jQuery has wrong searching scope. There is only 1 child "ul" element in element ".element1"');
9494
equal($('ul', element).length, 2, 'jQuery has wrong searching scope. There is only 2 "ul" elements in element ".element1"');
9595
equal($('> ul', element).length, 1, 'jQuery has wrong searching scope. There is only 1 child "ul" element in element ".element1"');
96+
97+
var shadowEl = document.createElement('div');
98+
99+
shadowEl.innerHTML = '<div class="shadow-el">test</div>';
100+
101+
equal($.contains(document.body, shadowEl), false, '"shadowEl" should not be placed in body');
102+
103+
var shadowTarget = $('div', shadowEl);
104+
105+
equal(shadowTarget.length, 1, 'jQuery should find only one div element inside "shadowEl"');
106+
equal(shadowTarget.hasClass('shadow-el'), true, 'div element finded inside "shadowEl" should have className "shadow-el"');
107+
96108
stop();
97109

98110
requrejsSandbox.set('PatchTest3', {

0 commit comments

Comments
 (0)