Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 28b54bb

Browse files
committed
test(jqLite): add test for #wrap() when mutliple elements are being wrapped
1 parent 77d3e75 commit 28b54bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/jqLiteSpec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,16 @@ describe('jqLite', function() {
15641564
expect(root.children().length).toBe(0);
15651565
expect(span.parent().hasClass('sigil')).toBeTruthy();
15661566
});
1567+
it('should wrap multiple elements', function() {
1568+
var root = jqLite('<div class="sigil"></div>');
1569+
var spans = jqLite('<span>A</span><span>B</span><span>C</span>');
1570+
1571+
spans.wrap(root);
1572+
1573+
expect(spans.eq(0).parent().hasClass('sigil')).toBeTruthy();
1574+
expect(spans.eq(1).parent().hasClass('sigil')).toBeTruthy();
1575+
expect(spans.eq(2).parent().hasClass('sigil')).toBeTruthy();
1576+
});
15671577
});
15681578

15691579

0 commit comments

Comments
 (0)