Skip to content

Commit

Permalink
Update nested template names.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Sep 3, 2019
1 parent 9e106d8 commit dc0754e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
24 changes: 12 additions & 12 deletions test/unit/dom-if-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ Polymer({
<x-foo prop="{{prop1}}"></x-foo>
<template is="dom-if" id="if-2" if="{{shouldStamp2}}">
<x-foo prop="{{prop2}}"></x-foo>
<template is="dom-if" id="if-3" if="{{shouldStamp3}}" restamp>
<x-foo prop="{{prop3}}"></x-foo>
<template is="dom-if" id="if-3-1" if="{{shouldStamp3_1}}" restamp>
<x-foo prop="{{prop3_1}}"></x-foo>
</template>
<template is="dom-if" id="if-4" if="{{shouldStamp4}}" restamp>
<x-foo prop="{{prop4}}"></x-foo>
<template is="dom-if" id="if-4-2" if="{{shouldStamp3_2}}" restamp>
<x-foo prop="{{prop3_2}}"></x-foo>
</template>
<template is="dom-if" id="if-5" if="{{shouldStamp5}}" restamp>
<x-foo prop="{{prop5}}"></x-foo>
<template is="dom-if" id="if-5-3" if="{{shouldStamp3_3}}" restamp>
<x-foo prop="{{prop3_3}}"></x-foo>
</template>
</template>
</template>
Expand All @@ -148,14 +148,14 @@ Polymer({
prop2: {
value: 'prop2'
},
prop3: {
value: 'prop3'
prop3_1: {
value: 'prop3_1'
},
prop4: {
value: 'prop4'
prop3_2: {
value: 'prop3_2'
},
prop5: {
value: 'prop5'
prop3_3: {
value: 'prop3_3'
},
item: {
value: function() { return {prop: 'outerItem'}; }
Expand Down
60 changes: 30 additions & 30 deletions test/unit/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,87 +178,87 @@
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
});

test('show 3', function() {
individual.shouldStamp3 = true;
test('show 3-1', function() {
individual.shouldStamp3_1 = true;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 3, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3-1 display wrong');
});

test('show 4', function() {
individual.shouldStamp4 = true;
test('show 3-2', function() {
individual.shouldStamp3_2 = true;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 4, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[3].prop, 'prop4');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(stamped[3].prop, 'prop3_2');
assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 4 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3-1 display wrong');
assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 3-2 display wrong');
});

test('remove 4', function() {
individual.shouldStamp4 = false;
test('remove 3-2', function() {
individual.shouldStamp3_2 = false;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 3, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3-1 display wrong');
});

test('show 5', function() {
individual.shouldStamp5 = true;
test('show 3-3', function() {
individual.shouldStamp3_3 = true;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 4, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[3].prop, 'prop5');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(stamped[3].prop, 'prop3_3');
assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 5 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3-1 display wrong');
assert.equal(getComputedStyle(stamped[3]).display, 'inline', 'stamped 3-3 display wrong');
});

test('update 5', function() {
individual.prop5 = 'prop5*';
test('update 3-3', function() {
individual.prop3_3 = 'prop3_3*';
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 4, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[3].prop, 'prop5*');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(stamped[3].prop, 'prop3_3*');
});

test('remove 5', function() {
individual.shouldStamp5 = false;
test('remove 3-3', function() {
individual.shouldStamp3_3 = false;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 3, 'total stamped count incorrect');
assert.equal(stamped[0].prop, 'prop1');
assert.equal(stamped[1].prop, 'prop2');
assert.equal(stamped[2].prop, 'prop3');
assert.equal(stamped[2].prop, 'prop3_1');
assert.equal(getComputedStyle(stamped[0]).display, 'inline', 'stamped 1 display wrong');
assert.equal(getComputedStyle(stamped[1]).display, 'inline', 'stamped 2 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3 display wrong');
assert.equal(getComputedStyle(stamped[2]).display, 'inline', 'stamped 3-1 display wrong');
});

test('remove 3', function() {
individual.shouldStamp3 = false;
individual.shouldStamp3_1 = false;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 2, 'total stamped count incorrect');
Expand Down Expand Up @@ -305,7 +305,7 @@
});

test('show 3', function() {
individual.shouldStamp3 = true;
individual.shouldStamp3_1 = true;
individual.render();
let stamped = individual.shadowRoot.querySelectorAll('*:not(template):not(dom-if):not(span)');
assert.equal(stamped.length, 3, 'total stamped count incorrect');
Expand Down

0 comments on commit dc0754e

Please sign in to comment.