diff --git a/test/unit/polymer.properties-element.html b/test/unit/polymer.properties-element.html index 8702759f4d..c0c21de587 100644 --- a/test/unit/polymer.properties-element.html +++ b/test/unit/polymer.properties-element.html @@ -25,7 +25,8 @@ static get properties() { return { prop: String, - noStomp: String + noStomp: String, + id: String }; } @@ -44,6 +45,15 @@ set noStomp(value) {} + get id() { + return super.id; + } + + set id(value) { + this._setProperty('id', value); + super.id = value; + } + connectedCallback() { super.connectedCallback(); this._calledConnectedCallback++; @@ -241,10 +251,20 @@ assert.deepEqual(el._propertiesChanged.args[0][0], {prop: 'prop'}); }); + test('properties: accessor for native property', function() { + el.setAttribute('id', 'yo'); + assert.equal(el.id, 'yo'); + el._flushProperties(); + assert.isTrue(el._propertiesChanged.calledTwice); + assert.deepEqual(el._propertiesChanged.args[1][1], {id: 'yo'}); + }); + test('attributes', function() { const fixtureEl = fixture('my-element-attr'); assert.equal(fixtureEl.prop, 'attr'); assert.equal(fixtureEl._callAttributeChangedCallback, 1); + fixtureEl.removeAttribute('prop'); + assert.equal(fixtureEl.prop, null); }); test('reflecting attributes', function() {