mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
Add user profile tests
This commit is contained in:
parent
58ca137911
commit
4ac921ca43
1 changed files with 39 additions and 0 deletions
39
app/tests/acceptance/user-profile-test.js
Normal file
39
app/tests/acceptance/user-profile-test.js
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import { test } from 'qunit';
|
||||||
|
import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
|
||||||
|
|
||||||
|
moduleForAcceptance('Acceptance | user profile');
|
||||||
|
|
||||||
|
test('visiting /profile', function(assert) {
|
||||||
|
userLogin();
|
||||||
|
visit('/profile');
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/profile');
|
||||||
|
assert.equal(find('#firstname').val(), 'Lennex', 'Firstaname input displays correct value');
|
||||||
|
assert.equal(find('#lastname').val(), 'Zinyando', 'Lastname input displays correct value');
|
||||||
|
assert.equal(find('#email').val(), 'brizdigital@gmail.com', 'Email input displays correct value');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('changing user details and email ', function(assert) {
|
||||||
|
userLogin();
|
||||||
|
visit('/profile');
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/profile');
|
||||||
|
assert.equal(find('.name').text().trim(), 'Lennex Zinyando', 'Profile name displayed');
|
||||||
|
assert.equal(find('#firstname').val(), 'Lennex', 'Firstaname input displays correct value');
|
||||||
|
assert.equal(find('#lastname').val(), 'Zinyando', 'Lastname input displays correct value');
|
||||||
|
assert.equal(find('#email').val(), 'brizdigital@gmail.com', 'Email input displays correct value');
|
||||||
|
});
|
||||||
|
|
||||||
|
fillIn('#firstname', 'Test');
|
||||||
|
fillIn('#lastname', 'User');
|
||||||
|
fillIn('#email', 'test.user@domain.com');
|
||||||
|
click('.button-blue');
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||||
|
assert.equal(find('.name').text().trim(), 'Test User', 'Profile name displayed');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue