Update cypress test, fix it
This commit is contained in:
parent
a81bb0e1e8
commit
a463f96167
|
|
@ -186,20 +186,36 @@ describe('The Room Page', () => {
|
|||
const {me} = MeQuery;
|
||||
const id = atob(me.id).split(':')[1];
|
||||
const authorId = btoa(`PublicUserNode:${id}`);
|
||||
const entrySlug = 'entry-slug';
|
||||
const roomEntry = {
|
||||
id: 'entry-id',
|
||||
slug: entrySlug,
|
||||
title: 'My Entry',
|
||||
contents: [
|
||||
{
|
||||
type: 'text_block',
|
||||
value: {
|
||||
text: 'some text'
|
||||
}
|
||||
}
|
||||
],
|
||||
comments: [],
|
||||
author: {
|
||||
...me,
|
||||
id: authorId,
|
||||
firstName: 'Hans',
|
||||
lastName: 'Was Heiri',
|
||||
avatarUrl: ''
|
||||
},
|
||||
};
|
||||
const room = {
|
||||
id: 'some-room',
|
||||
slug,
|
||||
// schoolClass: me.selectedClass,
|
||||
roomEntries: {
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
id: '',
|
||||
slug: '',
|
||||
contents: [],
|
||||
author: {
|
||||
...me,
|
||||
id: authorId,
|
||||
},
|
||||
},
|
||||
node: roomEntry,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -209,7 +225,9 @@ describe('The Room Page', () => {
|
|||
RoomEntriesQuery: {
|
||||
room,
|
||||
},
|
||||
RoomEntryQuery: {},
|
||||
RoomEntryQuery: {
|
||||
roomEntry
|
||||
},
|
||||
};
|
||||
cy.mockGraphqlOps({
|
||||
operations,
|
||||
|
|
@ -217,6 +235,7 @@ describe('The Room Page', () => {
|
|||
cy.visit(`/room/${slug}`);
|
||||
cy.getByDataCy('room-entry-actions').click();
|
||||
cy.getByDataCy('edit-room-entry').click();
|
||||
cy.location('pathname').should('include', entrySlug);
|
||||
});
|
||||
|
||||
it('creates a room entry', () => {
|
||||
|
|
@ -249,39 +268,39 @@ describe('The Room Page', () => {
|
|||
const otherClass = {
|
||||
id: btoa('SchoolClassNode:34'),
|
||||
name: 'Other Class',
|
||||
readOnly: false
|
||||
readOnly: false,
|
||||
};
|
||||
let selectedClass = me.selectedClass;
|
||||
const operations = {
|
||||
MeQuery: () => {
|
||||
return {
|
||||
me: {
|
||||
...me,
|
||||
schoolClasses: [...me.schoolClasses, otherClass],
|
||||
selectedClass
|
||||
},
|
||||
};
|
||||
me: {
|
||||
...me,
|
||||
schoolClasses: [...me.schoolClasses, otherClass],
|
||||
selectedClass,
|
||||
},
|
||||
};
|
||||
},
|
||||
RoomEntriesQuery,
|
||||
UpdateSettings() {
|
||||
selectedClass = otherClass;
|
||||
return {
|
||||
updateSettings: {
|
||||
success: true
|
||||
}
|
||||
success: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
ModuleDetailsQuery: {},
|
||||
MySchoolClassQuery: () => {
|
||||
return {
|
||||
me: {
|
||||
selectedClass
|
||||
}
|
||||
selectedClass,
|
||||
},
|
||||
};
|
||||
},
|
||||
RoomsQuery: {
|
||||
rooms: []
|
||||
}
|
||||
rooms: [],
|
||||
},
|
||||
};
|
||||
|
||||
cy.mockGraphqlOps({
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import DELETE_ROOM_MUTATION from 'gql/mutations/rooms/deleteRoom.gql';
|
||||
import UPDATE_ROOM_VISIBILITY_MUTATION from 'gql/mutations/rooms/updateRoomVisibility.gql';
|
||||
|
||||
|
|
@ -45,7 +44,6 @@
|
|||
components: {
|
||||
MoreActions,
|
||||
PopoverLink,
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<li
|
||||
class="popover-links__link"
|
||||
@click="$emit('link-action')"
|
||||
>
|
||||
<a
|
||||
class="popover-link"
|
||||
|
|
|
|||
Loading…
Reference in New Issue