chore: adds missing cypress test for assignment
This commit is contained in:
parent
9d1328c89d
commit
1fdc28419d
|
|
@ -18,21 +18,32 @@ const progress = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<BaseBox :details-link="'/statistic/assignment'">
|
||||
<BaseBox
|
||||
:details-link="'/statistic/assignment'"
|
||||
data-cy="dashboard.stats.assignments"
|
||||
>
|
||||
<template #title>{{ $t("a.Kompetenznachweis-Elemente") }}</template>
|
||||
<template #content>
|
||||
<div class="flex items-center">
|
||||
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
|
||||
<template #NUMBER>
|
||||
<span class="mr-3 text-4xl font-bold">{{ assignmentsCompleted }}</span>
|
||||
<span
|
||||
class="mr-3 text-4xl font-bold"
|
||||
data-cy="dashboard.stats.assignments.completed"
|
||||
>
|
||||
{{ assignmentsCompleted }}
|
||||
</span>
|
||||
</template>
|
||||
</i18next>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<i18next :translation="$t('a.{NUMBER} Bestanden')">
|
||||
<template #NUMBER>
|
||||
<span class="mr-3 text-4xl font-bold">
|
||||
{{ Math.round(props.avgPassed) }}%
|
||||
<span
|
||||
class="mr-3 text-4xl font-bold"
|
||||
data-cy="dashboard.stats.assignments.passed"
|
||||
>
|
||||
{{ `${Math.round(props.avgPassed)}%` }}
|
||||
</span>
|
||||
</template>
|
||||
</i18next>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,25 @@ describe("dashboardSupervisor.cy.js", () => {
|
|||
cy.visit("/");
|
||||
});
|
||||
|
||||
describe("assignment summary box", () => {
|
||||
it("contains correct numbers", () => {
|
||||
// we have no completed assignments, but some are in progress
|
||||
// -> makes sure that the numbers are correct
|
||||
getDashboardStatistics("assignments.completed").should("have.text", "0");
|
||||
getDashboardStatistics("assignments.passed").should("have.text", "0%");
|
||||
});
|
||||
|
||||
it("contains correct details link", () => {
|
||||
clickOnDetailsLink("assignments");
|
||||
|
||||
// might be improved: roughly check
|
||||
// that the correct data is displayed
|
||||
cy.contains("Noch nicht bestätigt");
|
||||
cy.contains("Fahrzeug - Mein erstes Auto");
|
||||
cy.contains("Test Bern 2022 a");
|
||||
});
|
||||
});
|
||||
|
||||
describe("attendance day summary box", () => {
|
||||
it("contains correct numbers", () => {
|
||||
getDashboardStatistics("attendance.dayCompleted").should("have.text", "1");
|
||||
|
|
@ -78,4 +97,5 @@ describe("dashboardSupervisor.cy.js", () => {
|
|||
cy.contains("Circle «Fahrzeug»")
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue