mirror of
https://github.com/documize/community.git
synced 2025-08-08 06:55:28 +02:00
Tests for when Anon access is enabled or disabled
This commit is contained in:
parent
0db8152143
commit
58ca137911
2 changed files with 40 additions and 0 deletions
16
app/tests/acceptance/anon-access-disabled-test.js
Normal file
16
app/tests/acceptance/anon-access-disabled-test.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { test, skip } from 'qunit';
|
||||||
|
import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
|
||||||
|
|
||||||
|
moduleForAcceptance('Acceptance | Anon access disabled');
|
||||||
|
|
||||||
|
|
||||||
|
test('visiting / when not authenticated and with { allowAnonymousAccess: false } takes user to login', function(assert) {
|
||||||
|
visit('/');
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/auth/login');
|
||||||
|
findWithAssert('#authEmail');
|
||||||
|
findWithAssert('#authPassword');
|
||||||
|
findWithAssert('button');
|
||||||
|
});
|
||||||
|
});
|
24
app/tests/acceptance/anon-access-enabled-test.js
Normal file
24
app/tests/acceptance/anon-access-enabled-test.js
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
import { test, skip } from 'qunit';
|
||||||
|
import moduleForAcceptance from 'documize/tests/helpers/module-for-acceptance';
|
||||||
|
|
||||||
|
moduleForAcceptance('Acceptance | Anon access enabled');
|
||||||
|
|
||||||
|
test('visiting / when not authenticated and with { allowAnonymousAccess: true } takes user to folder view', function(assert) {
|
||||||
|
server.create('app-meta', { allowAnonymousAccess: true });
|
||||||
|
visit('/');
|
||||||
|
|
||||||
|
return pauseTest();
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
skip('visiting / when authenticated and with { allowAnonymousAccess: true } takes user to dashboard', function(assert) {
|
||||||
|
server.create('app-meta', { allowAnonymousAccess: true });
|
||||||
|
userLogin();
|
||||||
|
|
||||||
|
andThen(function() {
|
||||||
|
assert.equal(currentURL(), '/s/VzMuyEw_3WqiafcG/my-project');
|
||||||
|
});
|
||||||
|
});
|
Loading…
Add table
Add a link
Reference in a new issue