mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
a6b11b8c0c
no issue - adds blank `/dashboard` route ready for future 4.0 related changes - `/` now redirects to `/dashboard` instead of `/site` - adds "Dashboard" link to main nav menu
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import {authenticateSession} from 'ember-simple-auth/test-support';
|
|
import {currentURL, visit} from '@ember/test-helpers';
|
|
import {describe, it} from 'mocha';
|
|
import {expect} from 'chai';
|
|
import {setupApplicationTest} from 'ember-mocha';
|
|
import {setupMirage} from 'ember-cli-mirage/test-support';
|
|
|
|
describe('Acceptance: Dashboard', function () {
|
|
const hooks = setupApplicationTest();
|
|
setupMirage(hooks);
|
|
|
|
it('is not accessible when logged out', async function () {
|
|
await visit('/dashboard');
|
|
expect(currentURL()).to.equal('/signin');
|
|
});
|
|
|
|
describe('when logged in', function () {
|
|
beforeEach(async function () {
|
|
let role = this.server.create('role', {name: 'Administrator'});
|
|
this.server.create('user', {roles: [role]});
|
|
|
|
return await authenticateSession();
|
|
});
|
|
|
|
it('can visit /dashboard', async function () {
|
|
await visit('/dashboard');
|
|
expect(currentURL()).to.equal('/dashboard');
|
|
});
|
|
|
|
it('/ redirects to /dashboard', async function () {
|
|
await visit('/');
|
|
expect(currentURL()).to.equal('/dashboard');
|
|
});
|
|
});
|
|
});
|