Created
July 11, 2015 15:29
-
-
Save barelyknown/ed18b2b7b4f258b691e3 to your computer and use it in GitHub Desktop.
login with valid credentials by pressing enter from password input
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
// login.hbs | |
// {{input value=identification name='identification'}} | |
// {{input value=password name='password' enter='authenticate'}} | |
// <button name='login' {{action 'authenticate'}}>Login</button> | |
// this test passes | |
test('login with valid credentials', function(assert) { | |
visit('/login'); | |
andThen(function() { | |
fillIn("input[name='identification']", "test@test.com"); | |
fillIn("input[name='password']", "12345678"); | |
click("button[name='login']"); | |
andThen(function() { | |
assert.equal(currentURL(), '/'); | |
}); | |
}); | |
}); | |
// this test does not pass | |
test('login with valid credentials by pressing enter from password input', function(assert) { | |
visit('/login'); | |
andThen(function() { | |
fillIn("input[name='identification']", "test@test.com"); | |
fillIn("input[name='password']", "12345678"); | |
keyEvent("input[name='password']", 'keydown', 13); | |
andThen(function() { | |
assert.equal(currentURL(), "/"); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment