Update another cypress test

This commit is contained in:
Ramon Wenger 2021-08-16 22:40:57 +02:00
parent ca522d385b
commit 2878097729
3 changed files with 11 additions and 9 deletions

View File

@ -88,6 +88,7 @@ export default {
teaser: '', teaser: '',
intro: '', intro: '',
assignments: {nodes: []}, assignments: {nodes: []},
objectiveGroups: [],
id: getModuleId(), id: getModuleId(),
}), }),
TopicNode: () => ({ TopicNode: () => ({

View File

@ -13,7 +13,7 @@ describe('New student', () => {
}); });
// todo: unskip me // 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'); cy.apolloLogin('hansli', 'test');
const name = 'KF1A'; const name = 'KF1A';
@ -47,7 +47,7 @@ describe('New student', () => {
cy.visit('/'); cy.visit('/');
cy.get('[data-cy=join-form-title]').should('contain', 'Einer Klasse beitreten'); 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.get('[data-cy=join-form-confirm]').click();
cy.getByDataCy('onboarding-skip-link').click(); cy.getByDataCy('onboarding-skip-link').click();
cy.get('[data-cy=user-widget-avatar]').click(); cy.get('[data-cy=user-widget-avatar]').click();

View File

@ -1,5 +1,5 @@
import getMe from '../../fixtures/me.minimal';
import module from '../../fixtures/module.minimal'; import module from '../../fixtures/module.minimal';
import {getMinimalMe} from '../../support/helpers';
const chapters = [{ const chapters = [{
title: 'ABC', title: 'ABC',
@ -15,27 +15,28 @@ const chapters = [{
}]; }];
const operations = { const operations = {
MeQuery: { MeQuery: getMinimalMe({isTeacher: true}),
me: getMe(true),
},
ModuleDetailsQuery: { ModuleDetailsQuery: {
module: { module: {
...module,
chapters, chapters,
}, },
}, },
DeleteContentBlock: { DeleteContentBlock: {
success: true, success: true,
}, },
UpdateLastModule: {}
}; };
describe('Custom Content Block', () => { describe('Custom Content Block', () => {
before(() => { beforeEach(() => {
cy.setup(); cy.setup();
}); });
it('Deletes the custom content block and removes it from the view', () => { 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.visit('module/some-module');
cy.log('Toggling Edit Mode'); cy.log('Toggling Edit Mode');