Skip to content

Commit 85184e8

Browse files
committed
Fix test for fallback _readyClients. Fixes #4547
1 parent 1478a06 commit 85184e8

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

lib/mixins/property-effects.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,14 +1507,14 @@
15071507
}
15081508

15091509
/**
1510-
* Overrides PropertyAccessor
1510+
* Overrides `PropertyAccessors` to call `_readyClients` callback
1511+
* if it was not called as a result of flushing properties.
15111512
*
15121513
* @override
15131514
*/
15141515
ready() {
1515-
let dataPending = this.__dataPending;
15161516
super.ready();
1517-
if (!dataPending) {
1517+
if (!this.__dataClientsInitialized) {
15181518
this._readyClients();
15191519
}
15201520
}

test/unit/configure.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,29 @@
296296
};
297297
</script>
298298

299+
<dom-module id="x-config-lazy-nodefaults">
300+
<template>
301+
<div>x-config-lazy-nodefaults</div>
302+
</template>
303+
<script>
304+
window.XConfigLazyNoDefaults = {
305+
is: 'x-config-lazy-nodefaults',
306+
properties: {
307+
prop: {
308+
observer: 'propChanged'
309+
}
310+
},
311+
created: function() {
312+
this.propChanged = sinon.spy();
313+
}
314+
};
315+
</script>
316+
</dom-module>
317+
299318
<dom-module id="x-config-lazy-host">
300319
<template>
301320
<x-config-lazy id="lazy" prop="{{foo}}" read-only-prop="{{foo}}" had-attr-prop="attrValue" bound-no-effect-prop="{{foo}}"></x-config-lazy>
321+
<x-config-lazy-nodefaults prop="[[foo]]"></x-config-lazy-nodefaults>
302322
</template>
303323
<script>
304324
HTMLImports.whenReady(function() {
@@ -491,6 +511,7 @@
491511
var el = document.createElement('x-config-lazy-host');
492512
document.body.appendChild(el);
493513
Polymer(window.XConfigLazy);
514+
Polymer(window.XConfigLazyNoDefaults);
494515
assert.equal(el.$.lazy.noEffectProp, 1);
495516
assert.equal(el.$.lazy.defaultUsesNoEffectProp, 2);
496517
assert.equal(el.$.lazy.boundNoEffectProp, 'foo');

0 commit comments

Comments
 (0)