mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Fix test for fallback _readyClients. Fixes #4547
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user