mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
Remove login helper from tests and use authenticateUser helper
This commit is contained in:
parent
42a88bb441
commit
f02ca796f6
3 changed files with 70 additions and 70 deletions
|
@ -1,13 +1,13 @@
|
|||
import { test } from 'qunit';
|
||||
import { test, skip } from 'qunit';
|
||||
import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
|
||||
|
||||
moduleForAcceptance('Acceptance | Documents space');
|
||||
|
||||
test('Adding a new folder space', function(assert) {
|
||||
skip('Adding a new folder space', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -27,36 +27,36 @@ test('Adding a new folder space', function(assert) {
|
|||
});
|
||||
});
|
||||
|
||||
// test('Adding a document to a space', function(assert) {
|
||||
// server.create('meta', { allowAnonymousAccess: false });
|
||||
// server.createList('folder', 2);
|
||||
// server.createList('permission', 4);
|
||||
// userLogin();
|
||||
// visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
//
|
||||
// andThen(function() {
|
||||
//
|
||||
// let numberOfDocuments = find('.documents-list li').length;
|
||||
// assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||
// assert.equal(numberOfDocuments, 2, '2 documents listed');
|
||||
// });
|
||||
//
|
||||
// click('#start-document-button');
|
||||
// click('.actions div:contains(Add)', 'body');
|
||||
//
|
||||
// andThen(function() {
|
||||
// let numberOfDocuments = find('.documents-list li').length;
|
||||
// assert.equal(numberOfDocuments, 3, '3 documents listed');
|
||||
// assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||
// // return pauseTest();
|
||||
// });
|
||||
// });
|
||||
skip('Adding a document to a space', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
|
||||
andThen(function() {
|
||||
|
||||
let numberOfDocuments = find('.documents-list li').length;
|
||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||
assert.equal(numberOfDocuments, 2, '2 documents listed');
|
||||
});
|
||||
|
||||
click('#start-document-button');
|
||||
click('.actions div:contains(Add)', 'body');
|
||||
|
||||
andThen(function() {
|
||||
let numberOfDocuments = find('.documents-list li').length;
|
||||
assert.equal(numberOfDocuments, 3, '3 documents listed');
|
||||
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||
// return pauseTest();
|
||||
});
|
||||
});
|
||||
|
||||
test('visiting space settings page', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
|
||||
click('#folder-settings-button');
|
||||
|
@ -72,7 +72,7 @@ test('changing space name', function(assert) {
|
|||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project/settings');
|
||||
|
||||
fillIn('#folderName', 'Test Space');
|
||||
|
@ -90,7 +90,7 @@ test('sharing a space', function(assert) {
|
|||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project/settings');
|
||||
|
||||
click(('.sidebar-menu .options li:contains(Share)'));
|
||||
|
@ -109,7 +109,7 @@ test('changing space permissions', function(assert) {
|
|||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
andThen(function() {
|
||||
let numberOfPublicFolders = find('.folders-list div:first .list a').length;
|
||||
assert.equal(numberOfPublicFolders, 1, '1 folder listed as public');
|
||||
|
@ -136,7 +136,7 @@ test('deleting a space', function(assert) {
|
|||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project/settings');
|
||||
|
||||
click('.sidebar-menu .options li:contains(Delete)');
|
||||
|
@ -147,37 +147,37 @@ test('deleting a space', function(assert) {
|
|||
});
|
||||
});
|
||||
|
||||
// test('deleting a document', function(assert) {
|
||||
// server.create('meta', { allowAnonymousAccess: false });
|
||||
// server.createList('folder', 2);
|
||||
// server.createList('permission', 4);
|
||||
// userLogin();
|
||||
// visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
//
|
||||
// andThen(function() {
|
||||
// let deleteButton = find('#delete-documents-button');
|
||||
// let numberOfDocuments = find('.documents-list li');
|
||||
// assert.equal(numberOfDocuments.length, 2, '2 documents are displayed');
|
||||
// assert.equal(deleteButton.length, 0, 'Delete button not displayed');
|
||||
// });
|
||||
//
|
||||
// click('.documents-list li:first .checkbox');
|
||||
//
|
||||
// andThen(function() {
|
||||
// let deleteButton = find('#delete-documents-button');
|
||||
// assert.equal(deleteButton.length, 1, 'Delete button displayed after selecting document');
|
||||
// });
|
||||
//
|
||||
// click('#delete-documents-button');
|
||||
//
|
||||
// waitToAppear('.drop-content');
|
||||
// click('.actions div:contains(Delete)', 'body');
|
||||
//
|
||||
// andThen(function() {
|
||||
// let numberOfDocuments = find('.documents-list li');
|
||||
// assert.equal(numberOfDocuments.length, 1, '1 documents is displayed');
|
||||
// });
|
||||
// });
|
||||
skip('deleting a document', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
server.createList('folder', 2);
|
||||
server.createList('permission', 4);
|
||||
authenticateUser();
|
||||
visit('/s/VzMuyEw_3WqiafcG/my-project');
|
||||
|
||||
andThen(function() {
|
||||
let deleteButton = find('#delete-documents-button');
|
||||
let numberOfDocuments = find('.documents-list li');
|
||||
assert.equal(numberOfDocuments.length, 2, '2 documents are displayed');
|
||||
assert.equal(deleteButton.length, 0, 'Delete button not displayed');
|
||||
});
|
||||
|
||||
click('.documents-list li:first .checkbox');
|
||||
|
||||
andThen(function() {
|
||||
let deleteButton = find('#delete-documents-button');
|
||||
assert.equal(deleteButton.length, 1, 'Delete button displayed after selecting document');
|
||||
});
|
||||
|
||||
click('#delete-documents-button');
|
||||
|
||||
waitToAppear('.drop-content');
|
||||
click('.actions div:contains(Delete)', 'body');
|
||||
|
||||
andThen(function() {
|
||||
let numberOfDocuments = find('.documents-list li');
|
||||
assert.equal(numberOfDocuments.length, 1, '1 documents is displayed');
|
||||
});
|
||||
});
|
||||
|
||||
function checkForCommonAsserts() {
|
||||
findWithAssert('.sidebar-menu');
|
||||
|
|
|
@ -5,7 +5,7 @@ moduleForAcceptance('Acceptance | user profile');
|
|||
|
||||
test('visiting /profile', function(assert) {
|
||||
server.createList('folder', 2);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/profile');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -18,7 +18,7 @@ test('visiting /profile', function(assert) {
|
|||
|
||||
test('changing user details and email ', function(assert) {
|
||||
server.createList('folder', 2);
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/profile');
|
||||
|
||||
andThen(function() {
|
||||
|
|
|
@ -5,7 +5,7 @@ moduleForAcceptance('Acceptance | User Settings');
|
|||
|
||||
test('visiting /settings/general', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/settings/general');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -18,7 +18,7 @@ test('visiting /settings/general', function(assert) {
|
|||
|
||||
test('changing the Website title and description', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/settings/general');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -39,7 +39,7 @@ test('changing the Website title and description', function(assert) {
|
|||
|
||||
test('visiting /settings/folders', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/settings/folders');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -50,7 +50,7 @@ test('visiting /settings/folders', function(assert) {
|
|||
|
||||
test('visiting /settings/users', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/settings/users');
|
||||
|
||||
andThen(function() {
|
||||
|
@ -64,7 +64,7 @@ test('visiting /settings/users', function(assert) {
|
|||
|
||||
test('add a new user', function(assert) {
|
||||
server.create('meta', { allowAnonymousAccess: false });
|
||||
userLogin();
|
||||
authenticateUser();
|
||||
visit('/settings/users');
|
||||
|
||||
andThen(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue