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

Commit c61626f

Browse files
jbedardrodyhaddad
authored andcommitted
test(jqLite): adding and removing data from SVG elements
1 parent 012ab1f commit c61626f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/jqLiteSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,18 @@ describe('jqLite', function() {
386386
selected.removeData('prop2');
387387
});
388388

389+
it('should add and remove data on SVGs', function() {
390+
var svg = jqLite('<svg><rect></rect></svg>');
391+
392+
svg.data('svg-level', 1);
393+
expect(svg.data('svg-level')).toBe(1);
394+
395+
svg.children().data('rect-level', 2);
396+
expect(svg.children().data('rect-level')).toBe(2);
397+
398+
svg.remove();
399+
});
400+
389401

390402
it('should not add to the cache if the node is a comment or text node', function() {
391403
var calcCacheSize = function() {

0 commit comments

Comments
 (0)