diff --git a/test/unit/dom-if.html b/test/unit/dom-if.html index 70db19ad8e..99239f251a 100644 --- a/test/unit/dom-if.html +++ b/test/unit/dom-if.html @@ -550,27 +550,6 @@ suite('attach/detach tests', function() { - test('remove, append domif', function(done) { - var domif = document.querySelector('#simple'); - domif.if = true; - outerContainer.removeChild(domif); - setTimeout(function() { - var clients = outerContainer.querySelectorAll('x-client'); - assert.equal(clients.length, 0); - outerContainer.appendChild(domif); - setTimeout(function() { - var clients = outerContainer.querySelectorAll('x-client'); - assert.equal(clients[0].uid, 0); - assert.equal(clients[1].uid, 1); - assert.equal(clients[2].uid, 2); - assert.equal(clients[1].previousElementSibling, clients[0]); - assert.equal(clients[2].previousElementSibling, clients[1]); - assert.equal(domif.previousElementSibling, clients[2]); - done(); - }); - }); - }); - test('move domif (clients persist)', function(done) { var domif = document.querySelector('#simple'); domif.if = true; @@ -674,6 +653,28 @@ }); }); + test('remove, append domif', function(done) { + var domif = document.querySelector('#simple'); + var parent = domif.parentNode; + domif.if = true; + parent.removeChild(domif); + setTimeout(function() { + var clients = parent.querySelectorAll('x-client'); + assert.equal(clients.length, 0); + parent.appendChild(domif); + setTimeout(function() { + var clients = parent.querySelectorAll('x-client'); + assert.equal(clients[0].uid, 12); + assert.equal(clients[1].uid, 13); + assert.equal(clients[2].uid, 14); + assert.equal(clients[1].previousElementSibling, clients[0]); + assert.equal(clients[2].previousElementSibling, clients[1]); + assert.equal(domif.previousElementSibling, clients[2]); + done(); + }); + }); + }); + test('move into doc fragment', function(done) { var el = shouldBeRemoved; assert.equal(el.parentNode, removalContainer);