wtorek, 19 sierpnia 2014

Ember.js testing focusOut

Quick note how to test focusOut in integration tests in ember.
I was writing signup form using easyForm with client side validations. Note that validations return a promise so we have async call. The feature was about displaying error when I leave field.
First I wrote this and it worked on local machine. But then on CI I started getting errors after running this again it occurs that it fails sometimes.

The solution was to invoke the blur even on element instead of going to another field.  Click helper is a async helper(http://emberjs.com/guides/testing/test-helpers/#toc_asynchronous-helpers) but it's probably waiting only for click event, not the corresponding ones.

Brak komentarzy:

Prześlij komentarz