From f96733d9eaf2f12f1c36dcb4d90b987020b5d36e Mon Sep 17 00:00:00 2001 From: Christian Cueni Date: Wed, 2 Oct 2024 14:55:32 +0200 Subject: [PATCH] Add cypress tests --- .../components/circle/DocumentListItem.vue | 7 +++- .../cockpit/documentPage/DocumentPage.vue | 3 ++ .../circlePage/DocumentSection.vue | 6 ++- cypress/e2e/cockpit/cockpitDocuments.cy.js | 41 +++++++++++++++++++ .../course/creators/test_course.py | 25 +++++++++++ 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 cypress/e2e/cockpit/cockpitDocuments.cy.js diff --git a/client/src/components/circle/DocumentListItem.vue b/client/src/components/circle/DocumentListItem.vue index b11f8327..212fa10a 100644 --- a/client/src/components/circle/DocumentListItem.vue +++ b/client/src/components/circle/DocumentListItem.vue @@ -8,7 +8,12 @@

{{ subtitle }}

- + diff --git a/client/src/pages/cockpit/documentPage/DocumentPage.vue b/client/src/pages/cockpit/documentPage/DocumentPage.vue index ad3c1a9d..de48a353 100644 --- a/client/src/pages/cockpit/documentPage/DocumentPage.vue +++ b/client/src/pages/cockpit/documentPage/DocumentPage.vue @@ -83,6 +83,8 @@ const canEditDocuments = computed(() => { const circleExperts = courseSessionDetailResult.filterCircleExperts( cockpitStore.currentCircle?.slug || "" ); + // hack-ish way to check if the user is an expert for the circle + // supervistors are not allowd to edit documents if they are not experts in the circle return circleExperts.some( (expert) => expert.user_id === userStore.id && @@ -157,6 +159,7 @@ async function uploadDocument(data: DocumentUploadData) {
-