improve test.

This commit is contained in:
Steven Orvell 2016-01-22 18:22:38 -08:00
parent aa14687250
commit d70c40ab05

View File

@ -1446,11 +1446,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('adding a document fragment clears nodes in the fragment', function() { test('adding a document fragment clears nodes in the fragment', function() {
var x = document.createElement('x-dist-star'); var x = document.createElement('x-dist-star');
var frag = document.createDocumentFragment(); var frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode('hi')); var t = document.createTextNode('hi');
frag.appendChild(document.createElement('div')); var d = document.createElement('div');
frag.appendChild(t);
frag.appendChild(d);
Polymer.dom(x).appendChild(frag); Polymer.dom(x).appendChild(frag);
Polymer.dom.flush(); Polymer.dom.flush();
assert.equal(frag.childNodes.length, 0); assert.equal(Polymer.dom(t).parentNode, x, 'logical parent wrong');
assert.equal(Polymer.dom(d).parentNode, x, 'logical parent wrong');
assert.equal(frag.childNodes.length, 0, 'fragment not empty');
}); });
test('adding a non-distributing node removes the node from its current location', function() { test('adding a non-distributing node removes the node from its current location', function() {
@ -1467,8 +1471,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}); });
suite('multi-content mutations', function() { suite('multi-content mutations', function() {
test('remove, append first content', function() { test('remove, append first content', function() {