Fixed tests

refs 7e28cf6be8

- referenced commit changed `dashboard` to redirect to `site` when logged in user is not an owner or admin
- updated tests to reflect the change
This commit is contained in:
Kevin Ansfield 2021-02-24 15:56:18 +00:00
parent 29b014233b
commit 4c8c71bf93
4 changed files with 8 additions and 8 deletions

View File

@ -20,14 +20,14 @@ describe('Acceptance: Members', function () {
expect(currentURL()).to.equal('/signin');
});
it('redirects non-admins to posts', async function () {
it('redirects non-admins to site', async function () {
let role = this.server.create('role', {name: 'Editor'});
this.server.create('user', {roles: [role]});
await authenticateSession();
await visit('/members');
expect(currentURL()).to.equal('/dashboard');
expect(currentURL()).to.equal('/site');
expect(find('[data-test-nav="members"]'), 'sidebar link')
.to.not.exist;
});

View File

@ -19,13 +19,13 @@ describe('Acceptance: Setup', function () {
await authenticateSession();
await visit('/setup/one');
expect(currentURL()).to.equal('/dashboard');
expect(currentURL()).to.equal('/site');
await visit('/setup/two');
expect(currentURL()).to.equal('/dashboard');
expect(currentURL()).to.equal('/site');
await visit('/setup/three');
expect(currentURL()).to.equal('/dashboard');
expect(currentURL()).to.equal('/site');
});
it('redirects to signin if already set up', async function () {

View File

@ -22,7 +22,7 @@ describe('Acceptance: Signin', function () {
await authenticateSession();
await visit('/signin');
expect(currentURL(), 'current url').to.equal('/dashboard');
expect(currentURL(), 'current url').to.equal('/site');
});
describe('when attempting to signin', function () {

View File

@ -167,7 +167,7 @@ describe('Acceptance: Signup', function () {
// submitting sends correct details and redirects to content screen
await click('.gh-btn-green');
expect(currentRouteName()).to.equal('dashboard');
expect(currentRouteName()).to.equal('site');
});
it('redirects if already logged in', async function () {
@ -185,7 +185,7 @@ describe('Acceptance: Signup', function () {
// "1470346017929|kevin+test2@ghost.org|2cDnQc3g7fQTj9nNK4iGPSGfvomkLdXf68FuWgS66Ug="
await visit('/signup/MTQ3MDM0NjAxNzkyOXxrZXZpbit0ZXN0MkBnaG9zdC5vcmd8MmNEblFjM2c3ZlFUajluTks0aUdQU0dmdm9ta0xkWGY2OEZ1V2dTNjZVZz0');
expect(currentRouteName()).to.equal('dashboard');
expect(currentRouteName()).to.equal('site');
expect(find('.gh-alert-content').textContent).to.have.string('sign out to register');
});