chore: adds missing cypress test for assignment
This commit is contained in:
parent
9d1328c89d
commit
1fdc28419d
|
|
@ -18,21 +18,32 @@ const progress = computed(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BaseBox :details-link="'/statistic/assignment'">
|
<BaseBox
|
||||||
|
:details-link="'/statistic/assignment'"
|
||||||
|
data-cy="dashboard.stats.assignments"
|
||||||
|
>
|
||||||
<template #title>{{ $t("a.Kompetenznachweis-Elemente") }}</template>
|
<template #title>{{ $t("a.Kompetenznachweis-Elemente") }}</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
|
<i18next :translation="$t('a.NUMBER Elemente abgeschlossen')">
|
||||||
<template #NUMBER>
|
<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>
|
</template>
|
||||||
</i18next>
|
</i18next>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<i18next :translation="$t('a.{NUMBER} Bestanden')">
|
<i18next :translation="$t('a.{NUMBER} Bestanden')">
|
||||||
<template #NUMBER>
|
<template #NUMBER>
|
||||||
<span class="mr-3 text-4xl font-bold">
|
<span
|
||||||
{{ Math.round(props.avgPassed) }}%
|
class="mr-3 text-4xl font-bold"
|
||||||
|
data-cy="dashboard.stats.assignments.passed"
|
||||||
|
>
|
||||||
|
{{ `${Math.round(props.avgPassed)}%` }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</i18next>
|
</i18next>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,25 @@ describe("dashboardSupervisor.cy.js", () => {
|
||||||
cy.visit("/");
|
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", () => {
|
describe("attendance day summary box", () => {
|
||||||
it("contains correct numbers", () => {
|
it("contains correct numbers", () => {
|
||||||
getDashboardStatistics("attendance.dayCompleted").should("have.text", "1");
|
getDashboardStatistics("attendance.dayCompleted").should("have.text", "1");
|
||||||
|
|
@ -78,4 +97,5 @@ describe("dashboardSupervisor.cy.js", () => {
|
||||||
cy.contains("Circle «Fahrzeug»")
|
cy.contains("Circle «Fahrzeug»")
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue