I am trying to write an assertion test that will test my login page on the app I am building. I am using both Ember Simple Auth and Ember Simple Auth Token. The test I am using to login looks like this:
test('Test login', function(assert) {
let done = assert.async();
visit('/sign-in');
fillIn('.email-input', 'test@test.com');
fillIn('.password-input', 'test1');
click('.submit');
andThen(function() {
assert.equal(currentURL(), '/dashboard');
done();
});
});
This is one of the first test I have written, so I am not great at it yet. I assume I need to put something like authenticateSession() somewhere in there, but I am not sure where. Also, the code above is causing a network error.
Do you think me not having that method in there is causing that undefined? All apologies for rookie questions, but anything would help.
Thanks!
Aucun commentaire:
Enregistrer un commentaire