Merge branch 'hotfix/room-entry-edit-form' into develop

This commit is contained in:
Ramon Wenger 2023-08-29 17:45:48 +02:00
commit ae394e99c0
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,70 @@
import { getMinimalMe } from '../../../support/helpers';
describe('Displays Edit Room Entry Page', () => {
const MeQuery = getMinimalMe();
const roomEntry = {
id: 1,
slug: 'hello',
title: 'A Room Entry',
comments: [],
author: {
id: MeQuery.me.id,
},
};
const content = {
id: '4885f806-1096-46a3-bfb1-fcf33bdec045',
type: 'subtitle',
value: {
text: 'I like turtles!',
},
};
const operations = {
MeQuery,
RoomEntryQuery: {
roomEntry: {
room: {
slug: 'some-room',
},
comments: undefined,
...roomEntry,
contents: [content],
},
},
RoomEntriesQuery: {
room: {
roomEntries: {
edges: [
{
node: roomEntry,
},
],
},
},
},
};
beforeEach(() => {
cy.setup();
cy.mockGraphqlOps({
operations,
});
});
it('visits the page and fills out the form', () => {
cy.visit('/room/some-room');
cy.getByDataCy('room-entry').within(() => {
cy.getByDataCy('toggle-more-actions-menu').click();
cy.getByDataCy('edit-room-entry').click();
});
cy.getByDataCy('content-form-title-section').within(() => {
cy.getByDataCy('input-with-label-input').should('contain.value', roomEntry.title);
});
cy.getByDataCy('content-form-section-title').should('contain', 'Untertitel');
cy.getByDataCy('subtitle-form-input').within(() => {
cy.getByDataCy('input-with-label-input').should('contain.value', content.value.text);
});
});
});

View File

@ -42,6 +42,7 @@ export default [
path: '/room/:slug/edit/:entrySlug',
name: UPDATE_ROOM_ENTRY_PAGE,
component: editRoomEntry,
props: true,
meta: { matomoUrlCallback: matomoRoomWithSlugCallback },
},
{