Skip to content

Commit

Permalink
Add test for large splice
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Aug 19, 2015
1 parent fccbd8a commit c967583
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
26 changes: 25 additions & 1 deletion test/unit/dom-repeat-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,28 @@
}
});
</script>
</dom-module>
</dom-module>

<dom-module id="x-primitive-large">
<template>
<template id="repeater" is="dom-repeat" items="{{items}}">
<div>{{item}}</div>
</template>
</template>
<script>
Polymer({
is: 'x-primitive-large',
properties: {
items: {
value: function() {
var ar = [];
for (var i = 0; i < 11; i++) {
ar.push(i);
}
return ar;
}
}
}
});
</script>
</dom-module>
14 changes: 14 additions & 0 deletions test/unit/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ <h4>inDocumentRepeater</h4>
</template>
</div>

<h4>x-primitive-large</h4>
<x-primitive-large id="primitiveLarge"></x-primitive-large>

<div id="inDocumentContainer">
</div>

Expand Down Expand Up @@ -1267,6 +1270,17 @@ <h4>inDocumentRepeater</h4>
});
});

test('large splice', function(done) {
primitiveLarge.splice('items', 0, 10);
setTimeout(function() {
var stamped =
Polymer.dom(primitiveLarge.root).querySelectorAll('*:not(template)');
assert.equal(stamped.length, 1, 'total stamped count incorrect');
assert.equal(stamped[0].textContent, '10');
done();
});
});

test('css scoping retained when re-ordering', function(done) {
if (!Polymer.Settings.useShadow) {
// Confirm initial scoping
Expand Down

0 comments on commit c967583

Please sign in to comment.