You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MockInteractions.pressAndReleaseKeyOn uses Polymer.Base.async to queue the keyUp event.
IronButtonState._asyncClick uses this.async to queue the click event, with a delay of 1.
This means test code has to do this:
MockInteractions.pressEnter(foo);
Polymer.dom.flush(); // flush MockInteraction's async call
foo.async(function() {
// test foo
}, 1); // schedule a setTimeout with a delay >= 1, so it runs after _asyncClick
The async call must have a delay greater than or equal to the one used in _asyncClickthanks to step 13. If you ever change the delay here, say from 1 to 10, my test code will fail.
(The Polymer.dom.flush() in the above is extraneous, but included for clarity.)
It would be nice if I could just do:
MockInteractions.pressEnter(foo);
Polymer.dom.flush(); // flush all the things
// test foo
MockInteractions.pressAndReleaseKeyOn
usesPolymer.Base.async
to queue thekeyUp
event.IronButtonState._asyncClick
usesthis.async
to queue theclick
event, with a delay of 1.This means test code has to do this:
The
async
call must have a delay greater than or equal to the one used in_asyncClick
thanks to step 13. If you ever change the delay here, say from1
to10
, my test code will fail.(The
Polymer.dom.flush()
in the above is extraneous, but included for clarity.)It would be nice if I could just do:
or even:
so I don't have to hard-code constants and keep them up-to-date with
_asyncClick
.The text was updated successfully, but these errors were encountered: