Update cypress test
This commit is contained in:
parent
934ee977f6
commit
afb0b7131d
|
|
@ -3,17 +3,33 @@ import {getMinimalMe} from '../../../support/helpers';
|
||||||
describe('The Rooms Page', () => {
|
describe('The Rooms Page', () => {
|
||||||
const getOperations = (isTeacher) => ({
|
const getOperations = (isTeacher) => ({
|
||||||
MeQuery: getMinimalMe({isTeacher}),
|
MeQuery: getMinimalMe({isTeacher}),
|
||||||
RoomsQuery: {},
|
RoomsQuery: {
|
||||||
|
rooms: {
|
||||||
|
edges: [
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
schoolClass: {
|
||||||
|
id: 'selectedClassId',
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.setup();
|
cy.setup();
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('shows the onboarding page', () => {
|
it('shows the onboarding page', () => {
|
||||||
const operations = getOperations(true);
|
const operations = getOperations(true);
|
||||||
cy.mockGraphqlOps({
|
cy.mockGraphqlOps({
|
||||||
operations,
|
operations: {
|
||||||
|
...operations,
|
||||||
|
RoomsQuery: {}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.visit('/rooms');
|
cy.visit('/rooms');
|
||||||
|
|
@ -32,6 +48,7 @@ describe('The Rooms Page', () => {
|
||||||
|
|
||||||
cy.visit('/rooms');
|
cy.visit('/rooms');
|
||||||
|
|
||||||
|
cy.getByDataCy('room-widget').should('have.length', 1);
|
||||||
cy.get('[data-cy=add-room]').should('exist');
|
cy.get('[data-cy=add-room]').should('exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -43,6 +60,7 @@ describe('The Rooms Page', () => {
|
||||||
|
|
||||||
cy.visit('/rooms');
|
cy.visit('/rooms');
|
||||||
|
|
||||||
|
cy.getByDataCy('room-widget').should('have.length', 1);
|
||||||
cy.get('[data-cy=add-room]').should('not.exist');
|
cy.get('[data-cy=add-room]').should('not.exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue