From 2878097729dc5774369ab705c42f09e0b0089dff Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Mon, 16 Aug 2021 22:40:57 +0200 Subject: [PATCH] Update another cypress test --- client/cypress/fixtures/mocks.js | 1 + .../cypress/integration/e2e/new-student.spec.js | 4 ++-- .../frontend/custom-content-block.spec.js | 15 ++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/client/cypress/fixtures/mocks.js b/client/cypress/fixtures/mocks.js index b3a97856..272bee86 100644 --- a/client/cypress/fixtures/mocks.js +++ b/client/cypress/fixtures/mocks.js @@ -88,6 +88,7 @@ export default { teaser: '', intro: '', assignments: {nodes: []}, + objectiveGroups: [], id: getModuleId(), }), TopicNode: () => ({ diff --git a/client/cypress/integration/e2e/new-student.spec.js b/client/cypress/integration/e2e/new-student.spec.js index dc31ae22..7d51c27b 100644 --- a/client/cypress/integration/e2e/new-student.spec.js +++ b/client/cypress/integration/e2e/new-student.spec.js @@ -13,7 +13,7 @@ describe('New student', () => { }); // todo: unskip me - it.skip('shows "Enter Code" page and adds the user to a class', () => { + it('shows "Enter Code" page and adds the user to a class', () => { cy.apolloLogin('hansli', 'test'); const name = 'KF1A'; @@ -47,7 +47,7 @@ describe('New student', () => { cy.visit('/'); cy.get('[data-cy=join-form-title]').should('contain', 'Einer Klasse beitreten'); - cy.get('[data-cy=input-form-code]').type('XXXX'); + cy.get('[data-cy=join-code-input]').type('XXXX'); cy.get('[data-cy=join-form-confirm]').click(); cy.getByDataCy('onboarding-skip-link').click(); cy.get('[data-cy=user-widget-avatar]').click(); diff --git a/client/cypress/integration/frontend/custom-content-block.spec.js b/client/cypress/integration/frontend/custom-content-block.spec.js index ab5f2cd5..a4290c74 100644 --- a/client/cypress/integration/frontend/custom-content-block.spec.js +++ b/client/cypress/integration/frontend/custom-content-block.spec.js @@ -1,5 +1,5 @@ -import getMe from '../../fixtures/me.minimal'; import module from '../../fixtures/module.minimal'; +import {getMinimalMe} from '../../support/helpers'; const chapters = [{ title: 'ABC', @@ -15,27 +15,28 @@ const chapters = [{ }]; const operations = { - MeQuery: { - me: getMe(true), - }, + MeQuery: getMinimalMe({isTeacher: true}), ModuleDetailsQuery: { module: { - ...module, chapters, }, }, DeleteContentBlock: { success: true, }, + UpdateLastModule: {} }; describe('Custom Content Block', () => { - before(() => { + beforeEach(() => { cy.setup(); }); it('Deletes the custom content block and removes it from the view', () => { - cy.fakeLogin('ross.geller', 'test'); + cy.mockGraphqlOps({ + operations, + }); + cy.visit('module/some-module'); cy.log('Toggling Edit Mode');