Fix tests

This commit is contained in:
Peter Zimon 2022-02-02 10:57:34 +01:00
parent dd12f75ab6
commit e782768a8c
9 changed files with 20 additions and 9 deletions

View File

@ -8,6 +8,7 @@ export default class SettingsDesignRoute extends AdminRoute {
@service settings;
@service themeManagement;
@service ui;
@service session;
model() {
// background refresh of preview
@ -22,6 +23,16 @@ export default class SettingsDesignRoute extends AdminRoute {
]);
}
beforeModel() {
super.beforeModel(...arguments);
const user = this.session.user;
if (!user.isAdmin) {
return this.transitionTo('settings.staff.user', user);
}
}
activate() {
this.ui.contextualNavMenu = 'design';
}

View File

@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - AMP', function () {
await authenticateSession();
await visit('/settings/integrations/amp');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {

View File

@ -29,7 +29,7 @@ describe('Acceptance: Settings - Code-Injection', function () {
await authenticateSession();
await visit('/settings/code-injection');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to staff page when authenticated as author', async function () {

View File

@ -25,7 +25,7 @@ describe('Acceptance: Settings - General', function () {
await authenticateSession();
await visit('/settings/general');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {

View File

@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
await authenticateSession();
await visit('/settings/integrations');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects /integrations/ to home page when authenticated as author', async function () {
@ -66,7 +66,7 @@ describe('Acceptance: Settings - Integrations - Custom', function () {
await authenticateSession();
await visit('/settings/integrations/1');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects /integrations/:id/ to home page when authenticated as author', async function () {

View File

@ -27,7 +27,7 @@ describe('Acceptance: Settings - Labs', function () {
await authenticateSession();
await visit('/settings/labs');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {

View File

@ -26,7 +26,7 @@ describe('Acceptance: Settings - Integrations - Slack', function () {
await authenticateSession();
await visit('/settings/integrations/slack');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {

View File

@ -29,7 +29,7 @@ describe('Acceptance: Settings - Integrations - Unsplash', function () {
await authenticateSession();
await visit('/settings/integrations/unsplash');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {

View File

@ -28,7 +28,7 @@ describe('Acceptance: Settings - Integrations - Zapier', function () {
await authenticateSession();
await visit('/settings/integrations/zapier');
expect(currentURL(), 'currentURL').to.equal('/site');
expect(currentURL(), 'currentURL').to.equal('/posts');
});
it('redirects to home page when authenticated as author', async function () {