Ghost/ghost/admin/tests/acceptance/launch-flow-test.js
Kevin Ansfield 4b5f3f64a4 Added launch wizard prototype
refs https://github.com/TryGhost/Team/issues/450

Initial prototype of new launch-site wizard, meant to speed up the setup of a members site with the following steps:

1. Customise design
2. Connect Stripe
3. Set subscription pricing

- added wizard link to dashboard screen
- added `/launch/*` screens representing the wizard steps
- duplicated and refactored relevant general and members setting code and templates into each step
2021-02-02 16:08:03 +00:00

63 lines
2.1 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: Launch flow', function () {
const hooks = setupApplicationTest();
setupMirage(hooks);
it('is not accessible when logged out', async function () {
await visit('/launch');
expect(currentURL()).to.equal('/signin');
await visit('/launch/customise-design');
expect(currentURL()).to.equal('/signin');
await visit('/launch/connect-stripe');
expect(currentURL()).to.equal('/signin');
await visit('/launch/set-pricing');
expect(currentURL()).to.equal('/signin');
await visit('/launch/complete');
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 /launch', async function () {
await visit('/launch');
expect(currentURL()).to.equal('/launch/customise-design');
});
it('can visit /launch/customise-design', async function () {
await visit('/launch/customise-design');
expect(currentURL()).to.equal('/launch/customise-design');
});
it('can visit /launch/connect-stripe', async function () {
await visit('/launch/connect-stripe');
expect(currentURL()).to.equal('/launch/connect-stripe');
});
it('can visit /launch/set-pricing', async function () {
await visit('/launch/set-pricing');
expect(currentURL()).to.equal('/launch/set-pricing');
});
it('can visit /launch/complete', async function () {
await visit('/launch/complete');
expect(currentURL()).to.equal('/launch/complete');
});
});
});