From 45598302678f2f9c8b8ead7756ad3e0c6652e064 Mon Sep 17 00:00:00 2001 From: valdrinkoshi Date: Thu, 28 Sep 2017 12:42:18 -0700 Subject: [PATCH] move test after --- test/unit/dom-if.html | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) 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);