Skip to content

Commit

Permalink
Fix test for fallback _readyClients. Fixes #4547
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 18, 2017
1 parent 1478a06 commit 85184e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/mixins/property-effects.html
Expand Up @@ -1507,14 +1507,14 @@
}

/**
* 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();
}
}
Expand Down
21 changes: 21 additions & 0 deletions test/unit/configure.html
Expand Up @@ -296,9 +296,29 @@
};
</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() {
Expand Down Expand Up @@ -491,6 +511,7 @@
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');
Expand Down

0 comments on commit 85184e8

Please sign in to comment.