Skip to content

Commit

Permalink
Avoid timing issues with polyfilled Promise
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Feb 9, 2018
1 parent d4a7a45 commit 6b3e007
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/path-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj');
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, nested.obj);
// x-pe uses async PropertiesChanged
Promise.resolve().then(() => {
setTimeout(() => {
assert.equal(el.$.pe._propertiesChanged.callCount, 1);
assert.equal(el.$.pe._propertiesChanged.firstCall.args[1].obj, nested.obj);
done();
Expand All @@ -124,7 +124,7 @@
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj');
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, nested.obj);
// x-pe uses async PropertiesChanged
Promise.resolve().then(() => {
setTimeout(() => {
assert.equal(el.$.pe._propertiesChanged.callCount, 1);
assert.equal(el.$.pe._propertiesChanged.firstCall.args[1].obj, nested.obj);
done();
Expand All @@ -142,7 +142,7 @@
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].path, 'obj.value');
assert.equal(el.$.forward.$.compose.objSubpathChanged.firstCall.args[0].value, 42);
// x-pe uses async PropertiesChanged
Promise.resolve().then(() => {
setTimeout(() => {
// Note the PropertiesMixin element only sees a deep set to 'nested.obj.value'
// because it overrides _shouldPropertyChange to allow object re-sets through
assert.equal(el.$.pe._propertiesChanged.callCount, 1);
Expand Down

0 comments on commit 6b3e007

Please sign in to comment.