From 2a91deb47d93428aae70441655601a02bc294873 Mon Sep 17 00:00:00 2001 From: Jan Slifka Date: Mon, 17 Jun 2024 10:12:09 +0200 Subject: [PATCH] Optimize loading of Project Detail --- cypress/e2e/projects/detail/websocket.spec.js | 6 +----- cypress/support/commands.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/projects/detail/websocket.spec.js b/cypress/e2e/projects/detail/websocket.spec.js index 721ed68..c8c5d7b 100644 --- a/cypress/e2e/projects/detail/websocket.spec.js +++ b/cypress/e2e/projects/detail/websocket.spec.js @@ -173,14 +173,10 @@ describe('Questionnaire WebSocket Tests', () => { cy.visitApp(`/projects/${projectUuid}`) // change sharing to restricted - cy.updateQuestionnaire(projectUuid, { + cy.updateQuestionnaireShare(projectUuid, { visibility: project.VisibleEdit, sharing: project.Restricted, - description: null, - name: projectName, permissions: [], - isTemplate: false, - projectTags: [], }) // check error appears diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 8e2ea45..0b604b2 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -223,6 +223,17 @@ Cypress.Commands.add('updateQuestionnaire', (questionnaireUuid, data) => { }) }) +Cypress.Commands.add('updateQuestionnaireShare', (questionnaireUuid, data) => { + getTokenFor('researcher').then((resp) => { + cy.request({ + method: 'PUT', + url: apiUrl(`/questionnaires/${questionnaireUuid}/share`), + headers: createHeaders(resp.body.token), + body: data + }) + }) +}) + Cypress.Commands.add('updateQuestionnaireContent', (questionnaireUuid, data) => { getTokenFor('researcher').then((resp) => { cy.request({