Fix cypress test
This commit is contained in:
parent
94a13f4a15
commit
1a3d9afd31
|
|
@ -1,51 +1,54 @@
|
|||
import mocks from '../../../fixtures/mocks';
|
||||
import {getMinimalMe} from '../../../support/helpers';
|
||||
|
||||
const SELECTED_CLASS_ID = 'selectedClassId';
|
||||
|
||||
const getOperations = ({readOnly, classReadOnly}) => ({
|
||||
MeQuery: {
|
||||
me: {
|
||||
readOnly,
|
||||
isTeacher: true,
|
||||
selectedClass: {
|
||||
id: SELECTED_CLASS_ID,
|
||||
readOnly: classReadOnly,
|
||||
const getOperations = ({readOnly, classReadOnly}) => {
|
||||
const {me} = getMinimalMe({readOnly, classReadOnly, isTeacher: true});
|
||||
return {
|
||||
MeQuery: {
|
||||
me: {
|
||||
...me,
|
||||
readOnly,
|
||||
selectedClass: {
|
||||
id: SELECTED_CLASS_ID,
|
||||
readOnly: classReadOnly,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
RoomEntriesQuery: {
|
||||
room: {
|
||||
id: 'roomId',
|
||||
slug: '',
|
||||
title: 'room title',
|
||||
entryCount: 3,
|
||||
appearance: 'blue',
|
||||
description: 'room description',
|
||||
schoolClass: {
|
||||
id: SELECTED_CLASS_ID,
|
||||
name: 'selected class',
|
||||
},
|
||||
roomEntries: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: 'entryId',
|
||||
RoomEntriesQuery: {
|
||||
room: {
|
||||
id: 'roomId',
|
||||
slug: '',
|
||||
title: 'room title',
|
||||
entryCount: 3,
|
||||
appearance: 'blue',
|
||||
description: 'room description',
|
||||
schoolClass: {
|
||||
id: SELECTED_CLASS_ID,
|
||||
name: 'selected class',
|
||||
},
|
||||
roomEntries: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: 'entryId',
|
||||
slug: '',
|
||||
title: 'entry title',
|
||||
contents: [],
|
||||
author: {
|
||||
id: 'authorId',
|
||||
id: btoa('PublicUserNode:authorId'),
|
||||
firstName: 'first',
|
||||
lastName: 'last',
|
||||
avatarUrl: ''
|
||||
}
|
||||
avatarUrl: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
const checkRoomReadOnly = ({editable, readOnly, classReadOnly = false}) => {
|
||||
const operations = getOperations({readOnly, classReadOnly});
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ describe('The Room Page', () => {
|
|||
});
|
||||
|
||||
cy.visit(`/room/${slug}`);
|
||||
cy.getByDataCy('add-room-entry').click();
|
||||
cy.getByDataCy('add-room-entry-button').click();
|
||||
cy.getByDataCy('add-room-entry-modal').should('exist');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
<div class="room__content">
|
||||
<add-room-entry-button
|
||||
:parent="room"
|
||||
data-cy="add-room-entry"
|
||||
v-if="room.id && !isReadOnly">
|
||||
<!--
|
||||
the v-if is there for the case where the room hasn't loaded yet, but there is already an attempt to create
|
||||
|
|
|
|||
Loading…
Reference in New Issue