diff --git a/.eslintignore b/.eslintignore index 552fce7fbf..15fd71546d 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,4 @@ node_modules/* bower_components/* -test/* src/**/demo/* src/**/experimental/* diff --git a/gulpfile.js b/gulpfile.js index b3e0227942..a3cf4e6881 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -127,7 +127,7 @@ gulp.task('release', function(cb) { }); gulp.task('lint', function() { - return gulp.src('src/**/*.html') + return gulp.src(['src/**/*.html', 'test/unit/*.html']) .pipe(eslint()) .pipe(eslint.format()) .pipe(eslint.failAfterError()); diff --git a/test/.eslintignore b/test/.eslintignore new file mode 100644 index 0000000000..1b153da58e --- /dev/null +++ b/test/.eslintignore @@ -0,0 +1,3 @@ +assets/* +compat/* +smoke/* diff --git a/test/.eslintrc.json b/test/.eslintrc.json new file mode 100644 index 0000000000..b210fb8fe4 --- /dev/null +++ b/test/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "env": { + "mocha": true + }, + "globals": { + "assert": true, + "sinon": true, + "WCT": true + } +} diff --git a/test/unit/array-selector.html b/test/unit/array-selector.html index b79e9f153c..7bce417a7a 100644 --- a/test/unit/array-selector.html +++ b/test/unit/array-selector.html @@ -32,10 +32,10 @@ - + + + + + + diff --git a/test/unit/attributes-elements.html b/test/unit/attributes-elements.html index 7a57dfb0fc..99184be70e 100644 --- a/test/unit/attributes-elements.html +++ b/test/unit/attributes-elements.html @@ -65,14 +65,14 @@ propChangedCount: 0, attr1ChangedCount: 0, - propChanged: function(prop) { + propChanged: function() { this.propChangedCount++; }, - attr1Changed: function(prop) { + attr1Changed: function() { this.attr1ChangedCount++; } - + }); @@ -154,4 +154,4 @@ this.setAttribute('prop2', 'hi'); } }); - \ No newline at end of file + diff --git a/test/unit/attributes.html b/test/unit/attributes.html index 76d4bd7685..19c105433c 100644 --- a/test/unit/attributes.html +++ b/test/unit/attributes.html @@ -55,6 +55,7 @@ - \ No newline at end of file + diff --git a/test/unit/css-parse.html b/test/unit/css-parse.html index e718ed4576..829882601c 100644 --- a/test/unit/css-parse.html +++ b/test/unit/css-parse.html @@ -1,182 +1,183 @@ - - - - - - - - - - - css-parse - - - - - - - - - - - - - - - - - + + + + + + + + + + + css-parse + + + + + + + + + + + + + + + + + diff --git a/test/unit/custom-style-late.html b/test/unit/custom-style-late.html index 92a28df75b..cbe0e95879 100644 --- a/test/unit/custom-style-late.html +++ b/test/unit/custom-style-late.html @@ -15,19 +15,20 @@ - + @@ -182,7 +183,7 @@ assert.equal(el.$.local.textContent, 'hey', 'dom-bind did not distribute'); document.body.removeChild(el); done(); - }) + }); }); test('dom-bind distributed when inserted in element attached (flush)', function() { diff --git a/test/unit/dom-if-elements.html b/test/unit/dom-if-elements.html index 238b9d4289..384c2a5a18 100644 --- a/test/unit/dom-if-elements.html +++ b/test/unit/dom-if-elements.html @@ -111,7 +111,7 @@ value: true }, prop: { - value: 'outer', + value: 'outer' }, item: { value: function() { return {prop: 'outerItem'}; } @@ -141,13 +141,13 @@ is: 'x-nested-if-individual', properties: { prop1: { - value: 'prop1', + value: 'prop1' }, prop2: { - value: 'prop2', + value: 'prop2' }, prop3: { - value: 'prop3', + value: 'prop3' }, item: { value: function() { return {prop: 'outerItem'}; } diff --git a/test/unit/dom-if.html b/test/unit/dom-if.html index 5b554b0174..584ac3b813 100644 --- a/test/unit/dom-if.html +++ b/test/unit/dom-if.html @@ -72,7 +72,7 @@ \ No newline at end of file + diff --git a/test/unit/dom-module.html b/test/unit/dom-module.html index cfab914ad0..68012ee960 100644 --- a/test/unit/dom-module.html +++ b/test/unit/dom-module.html @@ -52,9 +52,9 @@ }); test('mixed case element creation', function() { - t = new TestElement(); + var t = new TestElement(); //eslint-disable-line assert.ok(t.$.content); - }) + }); }); diff --git a/test/unit/dom-repeat-elements.html b/test/unit/dom-repeat-elements.html index 54ee9a5c5d..af97b73b24 100644 --- a/test/unit/dom-repeat-elements.html +++ b/test/unit/dom-repeat-elements.html @@ -26,7 +26,7 @@ { prop: 'prop-1-3-2' }, { prop: 'prop-1-3-3' } ] - }, + } ] }, { @@ -55,7 +55,7 @@ { prop: 'prop-2-3-2' }, { prop: 'prop-2-3-3' } ] - }, + } ] }, { @@ -84,7 +84,7 @@ { prop: 'prop-3-3-2' }, { prop: 'prop-3-3-3' } ] - }, + } ] } ]; @@ -129,19 +129,19 @@ notify: true }, inneraProp: { - notify: true, + notify: true }, itemaProp: { notify: true }, innerbProp: { - notify: true, + notify: true }, itembProp: { notify: true }, innercProp: { - notify: true, + notify: true }, itemcProp: { notify: true @@ -167,19 +167,19 @@ notify: true }, inneraProp: { - notify: true, + notify: true }, itemaProp: { notify: true }, innerbProp: { - notify: true, + notify: true }, itembProp: { notify: true }, innercProp: { - notify: true, + notify: true }, itemcProp: { notify: true @@ -310,7 +310,7 @@ value: window.data }, prop: { - value: 'outer', + value: 'outer' }, item: { value: function() { return {prop: 'outerItem'}; } @@ -467,7 +467,7 @@ created: function() { var time = performance.now(); time += 4; - while (performance.now() < time) {} + while (performance.now() < time) {} //eslint-disable-line no-empty } }); diff --git a/test/unit/dom-repeat.html b/test/unit/dom-repeat.html index 222619bc79..be42bb7d19 100644 --- a/test/unit/dom-repeat.html +++ b/test/unit/dom-repeat.html @@ -81,6 +81,7 @@

x-repeat-chunked

diff --git a/test/unit/gestures.html b/test/unit/gestures.html index 24efc9e15f..3f255a1eca 100644 --- a/test/unit/gestures.html +++ b/test/unit/gestures.html @@ -81,11 +81,11 @@ assert.equal(obj.mousedown.downup, 2, 'mousedown downup'); assert.equal(obj.mousedown.track, 1, 'mousedown track'); assert.equal(obj.mousedown.tap, 1, 'mousedown tap'); - assert.equal(obj.mousedown._count, 4, 'total mousedown') + assert.equal(obj.mousedown._count, 4, 'total mousedown'); assert.equal(obj.touchstart.downup, 2, 'touchstart downup'); assert.equal(obj.touchstart.tap, 1, 'touchstart tap'); assert.equal(obj.touchstart.track, 1, 'touchstart track'); - assert.equal(obj.touchstart._count, 4, 'total touchstart') + assert.equal(obj.touchstart._count, 4, 'total touchstart'); assert.equal(obj.touchmove.track, 1, 'touchmove track'); assert.equal(obj.touchmove._count, 1, 'total touchmove'); assert.equal(obj.touchend.downup, 2, 'touchend downup'); @@ -100,17 +100,17 @@ assert.equal(obj.mousedown.downup, 2, 'mousedown downup'); assert.equal(obj.mousedown.track, 1, 'mousedown track'); assert.equal(obj.mousedown.tap, 1, 'mousedown tap'); - assert.equal(obj.mousedown._count, 4, 'total mousedown') + assert.equal(obj.mousedown._count, 4, 'total mousedown'); assert.equal(obj.touchstart.downup, 2, 'touchstart downup'); assert.equal(obj.touchstart.tap, 1, 'touchstart tap'); assert.equal(obj.touchstart.track, 1, 'touchstart track'); - assert.equal(obj.touchstart._count, 4, 'total touchstart') + assert.equal(obj.touchstart._count, 4, 'total touchstart'); assert.equal(obj.touchmove.track, 1, 'touchmove track'); assert.equal(obj.touchmove._count, 1, 'total touchmove'); assert.equal(obj.touchend.downup, 2, 'touchend downup'); assert.equal(obj.touchend.track, 1, 'touchend track'); assert.equal(obj.touchend.tap, 1, 'touchend tap'); - assert.equal(obj.touchend._count, 4, 'total touchend');; + assert.equal(obj.touchend._count, 4, 'total touchend'); }); test('dynamic', function() { @@ -142,7 +142,7 @@ assert.equal(obj.touchstart.downup, 0, 'touchstart downup'); assert.equal(obj.touchstart._count, 0, 'total touchstart'); assert.equal(obj.touchmove.track, 0, 'touchmove track'); - assert.equal(obj.touchmove._count, 0, 'total touchmove') + assert.equal(obj.touchmove._count, 0, 'total touchmove'); assert.equal(obj.touchstart.tap, 0, 'touchstart tap'); assert.equal(obj.touchend.downup, 0, 'touchend downup'); assert.equal(obj.touchend.track, 0, 'touchend track'); @@ -164,7 +164,7 @@ assert.equal(obj.touchstart.downup, 0, 'touchstart downup'); assert.equal(obj.touchstart._count, 0, 'total touchstart'); assert.equal(obj.touchmove.track, 0, 'touchmove track'); - assert.equal(obj.touchmove._count, 0, 'total touchmove') + assert.equal(obj.touchmove._count, 0, 'total touchmove'); assert.equal(obj.touchstart.tap, 0, 'touchstart tap'); assert.equal(obj.touchend.downup, 0, 'touchend downup'); assert.equal(obj.touchend.track, 0, 'touchend track'); @@ -202,7 +202,7 @@ test('target finding returns null outside the window', function() { var actual = Polymer.Gestures.deepTargetFind(-1, -1); assert.equal(actual, null); - }) + }); test('find the div in document', function() { var x = divLocation.left, y = divLocation.top; diff --git a/test/unit/globals.html b/test/unit/globals.html index 34ae555298..c9a425db7a 100644 --- a/test/unit/globals.html +++ b/test/unit/globals.html @@ -14,6 +14,7 @@ @@ -71,7 +71,7 @@ }, observers: [ 'objSubpathChanged(obj.*)', - 'objValueChanged(obj.value)', + 'objValueChanged(obj.value)' ], created: function() { this.observerCounts = { @@ -96,7 +96,7 @@ objValueChanged: function(value) { this.observerCounts.objValueChanged++; assert.equal(this.obj.value, value); - }, + } }); @@ -211,7 +211,7 @@ 'arrayChanged keySplices incorrect'); } }, - arrayChangedDeep: function(info) { }, + arrayChangedDeep: function() { }, arrayNoCollChanged: function(splices) { this.observerCounts.arrayNoCollChanged++; if (this.arrayNoColl.length) { @@ -221,7 +221,7 @@ 'arrayNoCollChanged indexSplices incorrect'); } }, - arrayOrPropChanged: function(prop, splices) { + arrayOrPropChanged: function(prop) { this.observerCounts.arrayOrPropChanged++; assert.equal(prop, this.prop); }, diff --git a/test/unit/notify-path.html b/test/unit/notify-path.html index 74f24c8233..7c256edef3 100644 --- a/test/unit/notify-path.html +++ b/test/unit/notify-path.html @@ -813,7 +813,7 @@ el.arrayChanged = nop; el.array = ['orig1', 'orig2', 'orig3']; Polymer.Collection.get(el.array); - el.arrayChanged = function(change) { + el.arrayChanged = function() { throw new Error("should not notify"); }; var ret = el.push('array'); @@ -828,7 +828,7 @@ el.arrayChanged = nop; el.array = []; Polymer.Collection.get(el.array); - el.arrayChanged = function(change) { + el.arrayChanged = function() { throw new Error("should not notify"); }; var ret = el.pop('array'); @@ -840,8 +840,7 @@ el.arrayChanged = nop; el.array = ['orig1', 'orig2', 'orig3']; Polymer.Collection.get(el.array); - var key = el.array.length; - el.arrayChanged = function(change) { + el.arrayChanged = function() { throw new Error("should not notify"); }; var ret = el.unshift('array'); @@ -856,7 +855,7 @@ el.arrayChanged = nop; el.array = []; Polymer.Collection.get(el.array); - el.arrayChanged = function(change) { + el.arrayChanged = function() { throw new Error("should not notify"); }; var ret = el.shift('array'); @@ -868,9 +867,8 @@ test('corner: no-op splice array', function() { el.arrayChanged = nop; el.array = ['orig1', 'orig2', 'orig3']; - var key = el.array.length; Polymer.Collection.get(el.array); - el.arrayChanged = function(change) { + el.arrayChanged = function() { throw new Error("should not notify"); }; var ret = el.splice('array'); diff --git a/test/unit/polymer-dom-content.html b/test/unit/polymer-dom-content.html index 3b1bda2995..c34c320c95 100644 --- a/test/unit/polymer-dom-content.html +++ b/test/unit/polymer-dom-content.html @@ -306,7 +306,7 @@ // NOTE: these tests are mostly for Shady but running them on Shadow DOM // ensures Polymer.dom functions correctly under Shadow DOM. usingShady = !Polymer.Settings.useNativeShadow; - }) + }); suite('appendChild & removeChild of ', function() { @@ -988,6 +988,7 @@ var s1 = document.createElement('span'); var s2 = document.createElement('span'); var s3 = document.createElement('span'); + var composedChildren; frag.appendChild(s1); frag.appendChild(s2); frag.appendChild(s3); @@ -1000,7 +1001,7 @@ assert.equal(host.$.distWrapper.children[1], s2); assert.equal(host.$.distWrapper.children[2], s3); assert.equal(host.$.distWrapper.children[3], s0); - var composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); + composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); assert.equal(composedChildren.length, 4); assert.equal(composedChildren[0], s1); assert.equal(composedChildren[1], s2); @@ -1013,7 +1014,7 @@ Polymer.dom.flush(); if (host.shadyRoot) { assert.equal(host.$.distWrapper.children.length, 1); - var composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); + composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); assert.equal(composedChildren.length, 1); assert.equal(composedChildren[0], s0); } @@ -1027,6 +1028,7 @@ var s1 = document.createElement('span'); var s2 = document.createElement('span'); var s3 = document.createElement('span'); + var composedChildren; frag.appendChild(s1); frag.appendChild(s2); frag.appendChild(s3); @@ -1039,7 +1041,7 @@ assert.equal(host.$.distWrapper.children[1], s2); assert.equal(host.$.distWrapper.children[2], s3); assert.equal(host.$.distWrapper.children[3], s0); - var composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); + composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); assert.equal(composedChildren.length, 4); assert.equal(composedChildren[0], s1); assert.equal(composedChildren[1], s2); @@ -1052,7 +1054,7 @@ Polymer.dom.flush(); if (host.shadyRoot) { assert.equal(host.$.distWrapper.children.length, 1); - var composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); + composedChildren = Polymer.TreeApi.Composed.getChildNodes(host.$.distWrapper); assert.equal(composedChildren.length, 1); assert.equal(composedChildren[0], s0); } @@ -1139,7 +1141,7 @@ test('moving children between distributing host and fragment', function() { var h1 = document.createElement('x-dist'); - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = document.createElement('div'); @@ -1174,7 +1176,7 @@ var div = document.createElement('div'); div.innerHTML = '
'; var h1 = div.firstChild; - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = Polymer.dom(h1).firstElementChild; @@ -1285,7 +1287,7 @@ test('moving children between distributing host with deep insertion and fragment', function() { var h1 = document.createElement('x-dist-inside-deep-tree'); - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = document.createElement('div'); @@ -1320,7 +1322,7 @@ var div = document.createElement('div'); div.innerHTML = '
'; var h1 = div.firstChild; - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = Polymer.dom(h1).firstElementChild; @@ -1352,7 +1354,7 @@ test('moving children between distributing host with shallow insertion and fragment', function() { var h1 = document.createElement('x-dist-simple'); - var h2 = document.createDocumentFragment();; + var h2 = document.createDocumentFragment(); document.body.appendChild(h1); Polymer.dom.flush(); var d = document.createElement('div'); @@ -1730,7 +1732,7 @@ el.$.staticIf.if = true; Polymer.dom.flush(); assert.ok(Polymer.dom(el.root).querySelector('#static')); - var ip = Polymer.dom(el.root).querySelector('content'); + ip = Polymer.dom(el.root).querySelector('content'); assert.ok(ip); assert.equal(Polymer.dom(ip).getDistributedNodes()[0], c1); if (el.shadyRoot) { diff --git a/test/unit/polymer-dom-observeNodes.html b/test/unit/polymer-dom-observeNodes.html index e1e0d28816..3d1cdfd113 100644 --- a/test/unit/polymer-dom-observeNodes.html +++ b/test/unit/polymer-dom-observeNodes.html @@ -26,7 +26,7 @@ Polymer({ is:'test-static' }); - }); + }); @@ -143,7 +143,7 @@ Polymer({ is:'test-content-attr3' }); - }); + }); @@ -156,10 +156,10 @@ Polymer({ is:'test-content-attr-inside' }); - }); + }); - +
A
B
@@ -256,7 +256,7 @@ var recordedInfo, elAddedInObserver; var observerCallCount = 0; - var handle = Polymer.dom(el).observeNodes(function(info) { + Polymer.dom(el).observeNodes(function(info) { if (Polymer.dom(info.target).childNodes.length < 5) { elAddedInObserver = document.createElement('div'); Polymer.dom(info.target).appendChild(elAddedInObserver); @@ -307,9 +307,9 @@ assert.sameMembers(el.getEffectiveChildNodes(), nodes); Polymer.dom(el).unobserveNodes(handle); Polymer.dom(el).removeChild(d); - Polymer.dom(el).removeChild(d1); + Polymer.dom(el).removeChild(d1); setTimeout(function() { - assert.notEqual(nodes.length, el.getEffectiveChildNodes().length) + assert.notEqual(nodes.length, el.getEffectiveChildNodes().length); document.body.removeChild(el); done(); }); @@ -486,7 +486,7 @@ var el = document.createElement('test-content1'); document.body.appendChild(el); var recorded; - var handle = Polymer.dom(el.$.content).observeNodes(function(info) { + Polymer.dom(el.$.content).observeNodes(function(info) { recorded = info; }); Polymer.dom.flush(); @@ -518,7 +518,7 @@ var el = document.createElement('staticDiv'); document.body.appendChild(el); var recorded; - var handle = Polymer.dom(el).observeNodes(function(info) { + Polymer.dom(el).observeNodes(function(info) { recorded = info; }); Polymer.dom.flush(); @@ -681,10 +681,10 @@ }); }); }); - }); + }); }); - + test('observe effective children attr changes inside deep distributing element (async)', function(done) { var el = document.createElement('test-content-attr3'); document.body.appendChild(el); @@ -710,12 +710,12 @@ Polymer.dom(d).setAttribute('c', ''); setTimeout(function() { assert.equal(recorded.addedNodes.length, 1); - assert.equal(recorded.removedNodes.length, 0); + assert.equal(recorded.removedNodes.length, 0); assert.equal(recorded.addedNodes[0], d); Polymer.dom(d).removeAttribute('c'); setTimeout(function() { assert.equal(recorded.addedNodes.length, 0); - assert.equal(recorded.removedNodes.length, 1); + assert.equal(recorded.removedNodes.length, 1); assert.equal(recorded.removedNodes[0], d); recorded = null; Polymer.dom(content).unobserveNodes(handle); @@ -755,12 +755,12 @@ Polymer.dom(d).setAttribute('c', ''); setTimeout(function() { assert.equal(recorded.addedNodes.length, 1); - assert.equal(recorded.removedNodes.length, 0); + assert.equal(recorded.removedNodes.length, 0); assert.equal(recorded.addedNodes[0], d); Polymer.dom(d).removeAttribute('c'); setTimeout(function() { assert.equal(recorded.addedNodes.length, 0); - assert.equal(recorded.removedNodes.length, 1); + assert.equal(recorded.removedNodes.length, 1); assert.equal(recorded.removedNodes[0], d); recorded = null; Polymer.dom(content).unobserveNodes(handle); @@ -779,15 +779,15 @@ var el = document.createElement('test-content1'); document.body.appendChild(el); var r1 = 0; - var h1 = Polymer.dom(el.$.content).observeNodes(function(info) { + var h1 = Polymer.dom(el.$.content).observeNodes(function() { r1++; }); var r2 = 0; - var h2 = Polymer.dom(el.$.content).observeNodes(function(info) { + var h2 = Polymer.dom(el.$.content).observeNodes(function() { r2++; }); var r3 = 0; - var h3 = Polymer.dom(el.$.content).observeNodes(function(info) { + var h3 = Polymer.dom(el.$.content).observeNodes(function() { r3++; }); // add @@ -798,21 +798,21 @@ assert.equal(r2, 1); assert.equal(r3, 1); Polymer.dom(el.$.content).unobserveNodes(h1); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 1); assert.equal(r2, 2); assert.equal(r3, 2); Polymer.dom(el.$.content).unobserveNodes(h2); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 1); assert.equal(r2, 2); assert.equal(r3, 3); Polymer.dom(el.$.content).unobserveNodes(h3); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 1); @@ -825,28 +825,28 @@ assert.equal(r1, 2); assert.equal(r2, 3); assert.equal(r3, 4); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 3); assert.equal(r2, 4); assert.equal(r3, 5); Polymer.dom(el.$.content).unobserveNodes(h3); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 4); assert.equal(r2, 5); assert.equal(r3, 5); Polymer.dom(el.$.content).unobserveNodes(h2); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 5); assert.equal(r2, 5); assert.equal(r3, 5); Polymer.dom(el.$.content).unobserveNodes(h1); - var d = document.createElement('div'); + d = document.createElement('div'); Polymer.dom(el).appendChild(d); Polymer.dom.flush(); assert.equal(r1, 5); diff --git a/test/unit/ready-elements.html b/test/unit/ready-elements.html index 0422165d1b..2fb0b44628 100644 --- a/test/unit/ready-elements.html +++ b/test/unit/ready-elements.html @@ -2,18 +2,18 @@ var configureList = []; var readyList = []; - function clearTestLists() { + function clearTestLists() { //eslint-disable-line configureList = []; readyList = []; } var readyBehavior = { moniker: function() { - return this.is + (this.id ? '#' + this.id : '') + return this.is + (this.id ? '#' + this.id : ''); }, // use private, stateful, method for testing purposes _configure: function() { - chai.assert.isTrue(!this.isAttached, 'Element should not be attached when configured.'); + assert.isTrue(!this.isAttached, 'Element should not be attached when configured.'); configureList.push(this.moniker()); }, ready: function() { @@ -21,7 +21,7 @@ }, attached: function() { - chai.assert.isTrue(this._readied, 'Element not ready when attached'); + assert.isTrue(this._readied, 'Element not ready when attached'); } }; diff --git a/test/unit/ready.js b/test/unit/ready.js index f274576309..2f64c00c32 100644 --- a/test/unit/ready.js +++ b/test/unit/ready.js @@ -1,4 +1,5 @@ suite('ready', function() { + /* globals configureList readyList clearTestLists */ var configure = ['x-ready', 'x-zot#a', 'x-zot#b', 'x-zot#c', 'x-zot#d', 'x-foo#foo', 'x-bar#bar1', 'x-zot', 'x-bar#bar2', 'x-zot']; var ready = ['x-zot#a', 'x-zot#b', 'x-zot#c', 'x-zot#d', 'x-zot', 'x-bar#bar1', 'x-zot', 'x-bar#bar2', 'x-foo#foo', 'x-ready']; diff --git a/test/unit/shady.html b/test/unit/shady.html index b1abbfcd47..a94489a596 100644 --- a/test/unit/shady.html +++ b/test/unit/shady.html @@ -116,14 +116,14 @@ var b = p.firstChild; var content = p.lastChild; - + syncLightDOM(p); setRootInnerHTML(p.shadyRoot, 'a: b: '); var textNodeA = p.shadyRoot.firstChild; var contentA = p.shadyRoot.childNodes[1]; - var textNodeB = p.shadyRoot.childNodes[2] + var textNodeB = p.shadyRoot.childNodes[2]; var contentB = p.shadyRoot.childNodes[3]; function testRender() { @@ -252,7 +252,7 @@ test('removeChild - mutate shadow', function() { var host = document.createElement('x-content-test'); - + setInnerHTML(host, 'Hello'); syncLightDOM(host); @@ -360,7 +360,6 @@ test('replaceChild - mutate host', function() { var host = document.createElement('x-content-test'); setInnerHTML(host, 'Hello'); - var a = host.firstChild; syncLightDOM(host); setRootInnerHTML(host.shadyRoot, ''); @@ -408,7 +407,7 @@ // NOTE: needed only for this imperative test that needs // to simulate distribution from `shadyRoot` child._distributeContent(); - + assert.deepEqual(Polymer.dom(host.root).querySelectorAll('span#main'), [hostLocalMain]); assert.deepEqual(Polymer.dom(host.root).querySelectorAll('div#sub'), [childLightSub]); assert.deepEqual(Polymer.dom(child.root).querySelectorAll('span#sub'), [childLocalSub]); @@ -460,7 +459,7 @@ var temp = node.ownerDocument.createElement('div'); temp.innerHTML = value; var firstChild; - while (firstChild = temp.firstChild) { + while ((firstChild = temp.firstChild)) { nativeAppendChild.call(node, firstChild); } } diff --git a/test/unit/styling-cross-scope-unknown-host.html b/test/unit/styling-cross-scope-unknown-host.html index 9ad6181a37..678f0385c4 100644 --- a/test/unit/styling-cross-scope-unknown-host.html +++ b/test/unit/styling-cross-scope-unknown-host.html @@ -1,121 +1,122 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/templatizer.html b/test/unit/templatizer.html index a2538b26cc..0621232622 100644 --- a/test/unit/templatizer.html +++ b/test/unit/templatizer.html @@ -21,6 +21,7 @@