Skip to content

Commit

Permalink
Optimize loading of Project Detail
Browse files Browse the repository at this point in the history
  • Loading branch information
janslifka committed Jun 17, 2024
1 parent 4784e4f commit 2a91deb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 1 addition & 5 deletions cypress/e2e/projects/detail/websocket.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 2a91deb

Please sign in to comment.