2022-08-23 13:45:50 +03:00
|
|
|
import loginAsRole from '../../helpers/login-as-role';
|
|
|
|
import {currentURL} from '@ember/test-helpers';
|
|
|
|
import {expect} from 'chai';
|
|
|
|
import {setupApplicationTest} from 'ember-mocha';
|
|
|
|
import {setupMirage} from 'ember-cli-mirage/test-support';
|
|
|
|
import {visit} from '../../helpers/visit';
|
|
|
|
|
|
|
|
describe('Acceptance: Lexical editor', function () {
|
|
|
|
let hooks = setupApplicationTest();
|
|
|
|
setupMirage(hooks);
|
|
|
|
|
|
|
|
beforeEach(async function () {
|
|
|
|
this.server.loadFixtures();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('redirects to signin when not authenticated', async function () {
|
2023-10-04 14:22:54 +03:00
|
|
|
await visit('/editor/post/');
|
2022-08-23 13:45:50 +03:00
|
|
|
expect(currentURL(), 'currentURL').to.equal('/signin');
|
|
|
|
});
|
|
|
|
|
2023-10-02 22:32:05 +03:00
|
|
|
it('loads editor', async function () {
|
2022-08-23 13:45:50 +03:00
|
|
|
await loginAsRole('Administrator', this.server);
|
2023-10-04 14:22:54 +03:00
|
|
|
await visit('/editor/post/');
|
|
|
|
expect(currentURL(), 'currentURL').to.equal('/editor/post/');
|
2023-05-11 16:12:25 +03:00
|
|
|
});
|
2022-08-23 13:45:50 +03:00
|
|
|
});
|