mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
Refactor mirage config and tests to use new factories
This commit is contained in:
parent
663995b60d
commit
a215a05a88
5 changed files with 69 additions and 276 deletions
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -29,6 +29,7 @@ test('visiting / when not authenticated and with { allowAnonymousAccess: true }
|
|||
test('visiting / when authenticated and with { allowAnonymousAccess: true } takes user to dashboard', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: true });
|
||||
server.createList('folder', 2);
|
||||
server.createList('user', 2);
|
||||
visit('/');
|
||||
|
||||
andThen(function () {
|
||||
|
@ -38,8 +39,10 @@ test('visiting / when authenticated and with { allowAnonymousAccess: true } take
|
|||
|
||||
userLogin();
|
||||
|
||||
// return pauseTest();
|
||||
|
||||
andThen(function () {
|
||||
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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -66,6 +66,7 @@ test('visiting space settings page', function (assert) {
|
|||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
server.createList('folder-permission', 2);
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
|
||||
|
@ -203,4 +204,4 @@ function checkForCommonAsserts() {
|
|||
findWithAssert('.options li:contains(Share)');
|
||||
findWithAssert('.options li:contains(Permissions)');
|
||||
findWithAssert('.options li:contains(Delete)');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -16,6 +16,7 @@ moduleForAcceptance('Acceptance | user profile');
|
|||
|
||||
test('visiting /profile', function (assert) {
|
||||
server.createList('folder', 2);
|
||||
server.createList('user', 2);
|
||||
authenticateUser();
|
||||
visit('/profile');
|
||||
|
||||
|
@ -29,6 +30,7 @@ test('visiting /profile', function (assert) {
|
|||
|
||||
test('changing user details and email ', function (assert) {
|
||||
server.createList('folder', 2);
|
||||
server.createList('user', 2);
|
||||
authenticateUser();
|
||||
visit('/profile');
|
||||
|
||||
|
@ -49,4 +51,4 @@ test('changing user details and email ', function (assert) {
|
|||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||
assert.equal(find('.content .name').text().trim(), 'Test User', 'Profile name displayed');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
|
||||
//
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// This software (Documize Community Edition) is licensed under
|
||||
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
|
||||
//
|
||||
// You can operate outside the AGPL restrictions by purchasing
|
||||
// Documize Enterprise Edition and obtaining a commercial license
|
||||
// by contacting <sales@documize.com>.
|
||||
// by contacting <sales@documize.com>.
|
||||
//
|
||||
// https://documize.com
|
||||
|
||||
|
@ -16,6 +16,7 @@ moduleForAcceptance('Acceptance | User Settings');
|
|||
|
||||
test('visiting /settings/general', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('organization', 1);
|
||||
authenticateUser();
|
||||
visit('/settings/general');
|
||||
|
||||
|
@ -29,6 +30,7 @@ test('visiting /settings/general', function (assert) {
|
|||
|
||||
test('changing the Website title and description', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('organization', 1);
|
||||
authenticateUser();
|
||||
visit('/settings/general');
|
||||
|
||||
|
@ -61,6 +63,7 @@ test('visiting /settings/folders', function (assert) {
|
|||
|
||||
test('visiting /settings/users', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('user', 2);
|
||||
authenticateUser();
|
||||
visit('/settings/users');
|
||||
|
||||
|
@ -75,6 +78,7 @@ test('visiting /settings/users', function (assert) {
|
|||
|
||||
test('add a new user', function (assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('user', 2);
|
||||
authenticateUser();
|
||||
visit('/settings/users');
|
||||
|
||||
|
@ -107,4 +111,4 @@ function checkForCommonAsserts() {
|
|||
findWithAssert('#user-button');
|
||||
findWithAssert('#accounts-button');
|
||||
findWithAssert('.info .title');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue