From 82cf96bb6b12d5aef0d6ff06e73cf4941bcd4e43 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Mon, 20 Nov 2017 17:16:02 -0800 Subject: [PATCH] Update tests * Add test for implementing `observedAttributes` * Remove call to `super.id` for legacy browser support. --- test/unit/polymer.properties-element.html | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/unit/polymer.properties-element.html b/test/unit/polymer.properties-element.html index b53c836148..ed89ecf0dd 100644 --- a/test/unit/polymer.properties-element.html +++ b/test/unit/polymer.properties-element.html @@ -47,12 +47,13 @@ set noStomp(value) {} get id() { - return super.id; + return this._getProperty('id'); } set id(value) { this._setProperty('id', value); - super.id = value; + // cannot call super cuz older browsers + this._propertyToAttribute('id'); } connectedCallback() { @@ -93,6 +94,10 @@ class SubElement extends window.MyElement { + static get observedAttributes() { + return ['custom-observed-attr'].concat(super.observedAttributes); + } + static get properties() { return { prop2: String @@ -203,13 +208,13 @@ @@ -321,7 +326,7 @@ var fixtureEl = fixture('sub-element-attr'); assert.equal(fixtureEl.prop, 'attr'); assert.equal(fixtureEl.prop2, 'attr'); - assert.equal(fixtureEl._callAttributeChangedCallback, 2); + assert.equal(fixtureEl._callAttributeChangedCallback, 3); }); }); @@ -374,7 +379,7 @@ assert.strictEqual(fixtureEl.prop2, 'attr'); assert.strictEqual(fixtureEl.prop3, 'attr'); assert.strictEqual(fixtureEl.mixin, 5); - assert.equal(fixtureEl._callAttributeChangedCallback, 4); + assert.equal(fixtureEl._callAttributeChangedCallback, 5); }); });