diff --git a/client/cypress/fixtures/me.new-student.json b/client/cypress/fixtures/me.new-student.json index 054803d9..a59a5832 100644 --- a/client/cypress/fixtures/me.new-student.json +++ b/client/cypress/fixtures/me.new-student.json @@ -15,6 +15,7 @@ }, "onboardingVisited": false, "__typename": "UserNode", - "permissions": [] + "permissions": [], + "team": null } } diff --git a/client/cypress/integration/e2e/new-student.spec.js b/client/cypress/integration/e2e/new-student.spec.js index c493db08..6af340a4 100644 --- a/client/cypress/integration/e2e/new-student.spec.js +++ b/client/cypress/integration/e2e/new-student.spec.js @@ -4,13 +4,16 @@ const schema = require('../../fixtures/schema.json'); const me = require('../../fixtures/me.new-student.json'); describe('New student', () => { - it('shows "Enter Code" page and adds the user to a class', () => { + before(() => { cy.server(); - - cy.mockGraphql({ - schema: schema, + cy.task('getSchema').then(schema => { + cy.mockGraphql({ + schema, + }); }); + }); + it('shows "Enter Code" page and adds the user to a class', () => { cy.apolloLogin('hansli', 'test'); const __typename = 'SchoolClassNode'; @@ -26,9 +29,9 @@ describe('New student', () => { schoolClass: { id, name, - __typename - } - } + __typename, + }, + }, }, MySchoolClassQuery: { me: { @@ -37,12 +40,12 @@ describe('New student', () => { __typename, name, id, - members: [] - } - } + members: [], + }, + }, }, - ...mockUpdateOnboardingProgress() - } + ...mockUpdateOnboardingProgress(), + }, }); cy.visit('/');