From ea21a2ddc25807d223195b3e966483e0c4ef7e33 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 29 Aug 2023 16:15:23 +0200 Subject: [PATCH 1/2] Add failing test for the support problem on 2023-08-29 --- .../e2e/frontend/rooms/edit-room-entry.cy.ts | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 client/cypress/e2e/frontend/rooms/edit-room-entry.cy.ts diff --git a/client/cypress/e2e/frontend/rooms/edit-room-entry.cy.ts b/client/cypress/e2e/frontend/rooms/edit-room-entry.cy.ts new file mode 100644 index 00000000..d1b6ca99 --- /dev/null +++ b/client/cypress/e2e/frontend/rooms/edit-room-entry.cy.ts @@ -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); + }); + }); +}); From 1aaf31090d08d5587645c2cc9aeaece9e022f5be Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Tue, 29 Aug 2023 17:44:10 +0200 Subject: [PATCH 2/2] Fix routing entry for edit room entry page --- client/src/router/room.routes.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/router/room.routes.ts b/client/src/router/room.routes.ts index edb1576c..bd64a84b 100644 --- a/client/src/router/room.routes.ts +++ b/client/src/router/room.routes.ts @@ -42,6 +42,7 @@ export default [ path: '/room/:slug/edit/:entrySlug', name: UPDATE_ROOM_ENTRY_PAGE, component: editRoomEntry, + props: true, meta: { matomoUrlCallback: matomoRoomWithSlugCallback }, }, {