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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test 'Signup form', -> | |
click('input[name="businessName"]') | |
fillIn('input[name="businessName"]', "Some name") | |
click('input[name="contactName"]') | |
andThen -> | |
ok(find("div.businessName span.help-block.error").is(':visible'), "Should see error message on previous field") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ember.Test.registerAsyncHelper 'leaveBusinessName', | |
(app, name, context) -> | |
triggerEvent('input[name="businessName"]', 'blur') | |
test 'Signup form', -> | |
click('input[name="businessName"]') | |
fillIn('input[name="businessName"]', "Some name") | |
leaveBusinessName() | |
andThen -> | |
ok(find("div.businessName span.help-block.error").is(':visible'), "Should see error message on previous field") |
Brak komentarzy:
Prześlij komentarz