mirror of
https://github.com/documize/community.git
synced 2025-08-08 15:05:28 +02:00
Add SSO test
This commit is contained in:
parent
881da18e8a
commit
e26108b90b
6 changed files with 67 additions and 57 deletions
|
@ -3,7 +3,6 @@ import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
|
||||||
|
|
||||||
moduleForAcceptance('Acceptance | Anon access disabled');
|
moduleForAcceptance('Acceptance | Anon access disabled');
|
||||||
|
|
||||||
|
|
||||||
test('visiting / when not authenticated and with { allowAnonymousAccess: false } takes user to login', function (assert) {
|
test('visiting / when not authenticated and with { allowAnonymousAccess: false } takes user to login', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
|
|
|
@ -12,7 +12,7 @@ test('visiting / when not authenticated and with { allowAnonymousAccess: true }
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(find('.login').length, 1, 'Login button is displayed');
|
assert.equal(find('.login').length, 1, 'Login button is displayed');
|
||||||
assert.equal(find('.documents-list .document').length, 2, '2 document displayed');
|
assert.equal(find('.documents-list .document').length, 2, '2 document displayed');
|
||||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard and public spaces are displayed without being signed in');
|
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard and public spaces are displayed without being signed in');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -23,13 +23,13 @@ test('visiting / when authenticated and with { allowAnonymousAccess: true } take
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(find('.login').length, 1, 'Login button is displayed');
|
assert.equal(find('.login').length, 1, 'Login button is displayed');
|
||||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard displayed without being signed in');
|
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard displayed without being signed in');
|
||||||
});
|
});
|
||||||
|
|
||||||
userLogin();
|
userLogin();
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(find('.login').length, 0, 'Login button is not displayed');
|
assert.equal(find('.login').length, 0, 'Login button is not displayed');
|
||||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Dashboard is displayed after user is signed in');
|
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Dashboard is displayed after user is signed in');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,7 +13,7 @@ test('visiting /auth/login and logging in', function(assert) {
|
||||||
click('button');
|
click('button');
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project', 'Login successfull');
|
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Login successfull');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,6 +25,18 @@ test('logging out a user', function(assert) {
|
||||||
visit('/auth/logout');
|
visit('/auth/logout');
|
||||||
|
|
||||||
andThen(function () {
|
andThen(function () {
|
||||||
assert.equal(currentURL(), '/auth/login', 'Login successfull');
|
assert.equal(currentURL(), '/auth/login', 'Logging out successfull');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test('sso login', function (assert) {
|
||||||
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
server.createList('folder', 2);
|
||||||
|
userLogin();
|
||||||
|
|
||||||
|
visit('/auth/sso/OmJyaXpkaWdpdGFsQGdtYWlsLmNvbTp6aW55YW5kbzEyMw==');
|
||||||
|
|
||||||
|
andThen(function () {
|
||||||
|
assert.equal(currentURL(), '/s/VzMygEw_3WrtFzto/test', 'Login successfull');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,7 +107,6 @@ test('sharing a space', function(assert) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Test will pass after moving to factories
|
// Test will pass after moving to factories
|
||||||
test('changing space permissions', function (assert) {
|
test('changing space permissions', function (assert) {
|
||||||
server.create('meta', { allowAnonymousAccess: false });
|
server.create('meta', { allowAnonymousAccess: false });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue