Fix test for fallback _readyClients. Fixes #4547

This commit is contained in:
Kevin Schaaf
2017-04-18 14:14:30 -07:00
parent 1478a0680a
commit 85184e8b1a
2 changed files with 24 additions and 3 deletions
+3 -3
View File
@@ -1507,14 +1507,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
/**
* Overrides PropertyAccessor
* Overrides `PropertyAccessors` to call `_readyClients` callback
* if it was not called as a result of flushing properties.
*
* @override
*/
ready() {
let dataPending = this.__dataPending;
super.ready();
if (!dataPending) {
if (!this.__dataClientsInitialized) {
this._readyClients();
}
}
+21
View File
@@ -296,9 +296,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
};
</script>
<dom-module id="x-config-lazy-nodefaults">
<template>
<div>x-config-lazy-nodefaults</div>
</template>
<script>
window.XConfigLazyNoDefaults = {
is: 'x-config-lazy-nodefaults',
properties: {
prop: {
observer: 'propChanged'
}
},
created: function() {
this.propChanged = sinon.spy();
}
};
</script>
</dom-module>
<dom-module id="x-config-lazy-host">
<template>
<x-config-lazy id="lazy" prop="{{foo}}" read-only-prop="{{foo}}" had-attr-prop="attrValue" bound-no-effect-prop="{{foo}}"></x-config-lazy>
<x-config-lazy-nodefaults prop="[[foo]]"></x-config-lazy-nodefaults>
</template>
<script>
HTMLImports.whenReady(function() {
@@ -491,6 +511,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var el = document.createElement('x-config-lazy-host');
document.body.appendChild(el);
Polymer(window.XConfigLazy);
Polymer(window.XConfigLazyNoDefaults);
assert.equal(el.$.lazy.noEffectProp, 1);
assert.equal(el.$.lazy.defaultUsesNoEffectProp, 2);
assert.equal(el.$.lazy.boundNoEffectProp, 'foo');