69 lines
1.4 KiB
JavaScript
69 lines
1.4 KiB
JavaScript
const schema = require('../fixtures/schema.json');
|
|
const me = require('../fixtures/me.join-class.json');
|
|
|
|
describe('Onboarding', () => {
|
|
beforeEach(() => {
|
|
cy.server();
|
|
|
|
cy.mockGraphql({
|
|
schema: schema,
|
|
});
|
|
});
|
|
|
|
it('shows the onboarding steps and finishes them', () => {
|
|
cy.apolloLogin('hansli', 'test');
|
|
|
|
cy.mockGraphqlOps({
|
|
operations: {
|
|
MeQuery: {
|
|
me: {
|
|
...me.me,
|
|
onboardingVisited: false
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
cy.visit('/');
|
|
cy.assertStartPage(true);
|
|
cy.get('[data-cy=onboarding-next-link]').click();
|
|
cy.get('[data-cy=onboarding-next-link]').click();
|
|
cy.get('[data-cy=onboarding-next-link]').click();
|
|
cy.get('[data-cy=onboarding-next-link]').click();
|
|
cy.assertStartPage(false);
|
|
});
|
|
|
|
it('shows the onboarding steps and skips them', () => {
|
|
cy.apolloLogin('hansli', 'test');
|
|
|
|
cy.mockGraphqlOps({
|
|
operations: {
|
|
MeQuery: {
|
|
me: {
|
|
...me.me,
|
|
onboardingVisited: false
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
cy.visit('/');
|
|
cy.assertStartPage(true);
|
|
cy.skipOnboarding();
|
|
cy.assertStartPage(false);
|
|
});
|
|
|
|
it('does not show the onboarding', () => {
|
|
cy.apolloLogin('hansli', 'test');
|
|
|
|
cy.mockGraphqlOps({
|
|
operations: {
|
|
MeQuery: me
|
|
}
|
|
});
|
|
|
|
cy.visit('/');
|
|
cy.assertStartPage(false);
|
|
});
|
|
});
|