mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
57bc14e00f
ref https://github.com/TryGhost/Team/issues/2421 - added the Mentions API endpoint to Admin - setup initial mention model in the Ember Store to be able to dev with the endpoint - added basic routing to access the `/mentions` page that is currently behind feature flags - Setup basic testing with a mirage mock endpoint.
36 lines
1.3 KiB
JavaScript
36 lines
1.3 KiB
JavaScript
import {authenticateSession, invalidateSession} from 'ember-simple-auth/test-support';
|
|
import {currentURL, visit} from '@ember/test-helpers';
|
|
import {describe, it} from 'mocha';
|
|
import {enableLabsFlag} from '../helpers/labs-flag';
|
|
import {expect} from 'chai';
|
|
import {setupApplicationTest} from 'ember-mocha';
|
|
import {setupMirage} from 'ember-cli-mirage/test-support';
|
|
|
|
describe('Acceptance: Mentions', function () {
|
|
const hooks = setupApplicationTest();
|
|
setupMirage(hooks);
|
|
|
|
it('redirects to signin when not authenticated', async function () {
|
|
await invalidateSession();
|
|
await visit('/mentions');
|
|
expect(currentURL()).to.equal('/signin');
|
|
});
|
|
|
|
describe('as admin', function () {
|
|
beforeEach(async function () {
|
|
this.server.loadFixtures('configs');
|
|
this.server.loadFixtures('settings');
|
|
|
|
let role = this.server.create('role', {name: 'Administrator'});
|
|
this.server.create('user', {roles: [role]});
|
|
enableLabsFlag(this.server, 'webmentions');
|
|
return await authenticateSession();
|
|
});
|
|
it('can render mentions page', async function () {
|
|
await visit('/mentions');
|
|
expect(currentURL(), 'currentURL').to.equal('/mentions');
|
|
});
|
|
});
|
|
});
|
|
|