From 966533e13bc5de38cf901009aa5a4010c4d56104 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Tue, 26 Sep 2023 18:46:51 +0200 Subject: [PATCH] Add feedback trainer cypress test --- .../src/components/ui/HorizontalBarChart.vue | 4 +- client/src/components/ui/RatingScale.vue | 1 + client/src/components/ui/VerticalBarChart.vue | 9 +- client/src/pages/cockpit/FeedbackPage.vue | 12 ++- .../cockpitPage/SubmissionsOverview.vue | 6 +- cypress/e2e/feedback/feedbackStudent.cy.js | 2 +- cypress/e2e/feedback/feedbackTrainer.cy.js | 92 +++++++++++++++++++ .../core/management/commands/cypress_reset.py | 12 +-- server/vbv_lernwelt/feedback/factories.py | 2 +- server/vbv_lernwelt/feedback/services.py | 2 +- 10 files changed, 124 insertions(+), 18 deletions(-) create mode 100644 cypress/e2e/feedback/feedbackTrainer.cy.js diff --git a/client/src/components/ui/HorizontalBarChart.vue b/client/src/components/ui/HorizontalBarChart.vue index b7693079..e9eed75f 100644 --- a/client/src/components/ui/HorizontalBarChart.vue +++ b/client/src/components/ui/HorizontalBarChart.vue @@ -26,7 +26,9 @@ class="h-8 bg-sky-500" :style="{ width: `${percentage * 100 * 0.8}%` }" > -
{{ (percentage * 100).toFixed(1) }}%
+
+ {{ (percentage * 100).toFixed(1) }}% +
diff --git a/client/src/components/ui/RatingScale.vue b/client/src/components/ui/RatingScale.vue index 495936cc..4afaa72d 100644 --- a/client/src/components/ui/RatingScale.vue +++ b/client/src/components/ui/RatingScale.vue @@ -5,6 +5,7 @@ {{ rating.toFixed(1) }} diff --git a/client/src/components/ui/VerticalBarChart.vue b/client/src/components/ui/VerticalBarChart.vue index 8719ebab..8a913440 100644 --- a/client/src/components/ui/VerticalBarChart.vue +++ b/client/src/components/ui/VerticalBarChart.vue @@ -28,14 +28,14 @@ :style="greenStyle" >
- + {{ $t("general.no") }} -

+

{{ `"${$t("general.no")}" ${numberOfRatings["no"]} ${$t( "feedback.answers" @@ -46,14 +46,14 @@

- + {{ $t("general.yes") }} -

+

{{ `"${$t("general.yes")}" ${numberOfRatings["yes"]} ${$t( "feedback.answers" @@ -71,6 +71,7 @@ import QuestionSummary from "@/components/ui/QuestionSummary.vue"; import { Popover, PopoverButton, PopoverPanel } from "@headlessui/vue"; import { computed } from "vue"; + const props = defineProps<{ ratings: boolean[]; title: string; diff --git a/client/src/pages/cockpit/FeedbackPage.vue b/client/src/pages/cockpit/FeedbackPage.vue index d85a0750..69bdaf47 100644 --- a/client/src/pages/cockpit/FeedbackPage.vue +++ b/client/src/pages/cockpit/FeedbackPage.vue @@ -13,11 +13,17 @@

{{ $t("feedback.feedbackPageTitle") }}

- {{ feedbackData.amount }} + + {{ feedbackData.amount }} + {{ $t("feedback.feedbackPageInfo") }}

-
    -
  1. +
      +
    1. {