Update cypress test

This commit is contained in:
Ramon Wenger 2021-08-18 19:00:00 +02:00
parent 934ee977f6
commit afb0b7131d
1 changed files with 21 additions and 3 deletions

View File

@ -3,17 +3,33 @@ import {getMinimalMe} from '../../../support/helpers';
describe('The Rooms Page', () => {
const getOperations = (isTeacher) => ({
MeQuery: getMinimalMe({isTeacher}),
RoomsQuery: {},
RoomsQuery: {
rooms: {
edges: [
{
node: {
schoolClass: {
id: 'selectedClassId',
},
},
},
],
},
},
});
beforeEach(() => {
cy.setup();
});
it.only('shows the onboarding page', () => {
it('shows the onboarding page', () => {
const operations = getOperations(true);
cy.mockGraphqlOps({
operations,
operations: {
...operations,
RoomsQuery: {}
},
});
cy.visit('/rooms');
@ -32,6 +48,7 @@ describe('The Rooms Page', () => {
cy.visit('/rooms');
cy.getByDataCy('room-widget').should('have.length', 1);
cy.get('[data-cy=add-room]').should('exist');
});
@ -43,6 +60,7 @@ describe('The Rooms Page', () => {
cy.visit('/rooms');
cy.getByDataCy('room-widget').should('have.length', 1);
cy.get('[data-cy=add-room]').should('not.exist');
});
});