From 63427745e33e85188d31af0b81bc413b36d44533 Mon Sep 17 00:00:00 2001 From: Tokiniaina RAKOTOZANANY Date: Wed, 29 Jul 2026 08:53:42 +0300 Subject: [PATCH 1/5] it is to test fees only test --- .github/workflows/ci.yml | 21 ++++++++-- cypress/e2e/fees-only/fees-only.cy.js | 38 +++++++++++++++++++ cypress/e2e/{ => full-mode}/admin.docs.cy.tsx | 8 ++-- cypress/e2e/{ => full-mode}/admin.staff.cy.ts | 4 +- .../e2e/{ => full-mode}/admin.welcome.cy.tsx | 12 +++--- .../{ => full-mode}/authentification.cy.tsx | 2 +- .../e2e/{ => full-mode}/certificate.cy.tsx | 2 +- cypress/e2e/{ => full-mode}/comments.cy.tsx | 4 +- cypress/e2e/{ => full-mode}/cor.manager.cy.ts | 6 +-- cypress/e2e/{ => full-mode}/download.cy.tsx | 4 +- .../e2e/{ => full-mode}/event.manager.cy.tsx | 8 ++-- .../e2e/{ => full-mode}/event.student.cy.tsx | 4 +- .../e2e/{ => full-mode}/event.teacher.cy.tsx | 2 +- cypress/e2e/{ => full-mode}/exam.card.cy.tsx | 2 +- .../exam.participant.list.cy.tsx | 8 ++-- cypress/e2e/{ => full-mode}/function.cy.ts | 0 .../e2e/{ => full-mode}/grade-overview.cy.ts | 8 ++-- .../{ => full-mode}/grades.components.cy.tsx | 6 +-- cypress/e2e/{ => full-mode}/helpers.cy.ts | 0 cypress/e2e/{ => full-mode}/importConf.cy.ts | 0 .../e2e/{ => full-mode}/letter.event.cy.tsx | 6 +-- .../{ => full-mode}/letters.manager.cy.tsx | 4 +- .../e2e/{ => full-mode}/letters.users.cy.tsx | 6 +-- .../manager.announcements.cy.tsx | 2 +- .../e2e/{ => full-mode}/manager.course.cy.tsx | 8 ++-- cypress/e2e/{ => full-mode}/manager.cy.tsx | 6 +-- .../e2e/{ => full-mode}/manager.docs.cy.tsx | 4 +- .../e2e/{ => full-mode}/manager.fees.cy.tsx | 10 ++--- .../manager.fees.import.cy.tsx | 8 ++-- .../{ => full-mode}/manager.fees.mpbs.cy.tsx | 4 +- .../manager.fees.templates.cy.tsx | 2 +- .../e2e/{ => full-mode}/manager.groups.cy.tsx | 4 +- .../{ => full-mode}/manager.monitor.cy.tsx | 6 +-- .../{ => full-mode}/manager.payments.cy.tsx | 6 +-- .../{ => full-mode}/manager.promotions.cy.tsx | 4 +- .../{ => full-mode}/manager.students.cy.tsx | 10 ++--- .../{ => full-mode}/manager.teachers.cy.tsx | 4 +- .../manager.teachers.import.cy.tsx | 6 +-- cypress/e2e/{ => full-mode}/monitor.cy.tsx | 4 +- .../e2e/{ => full-mode}/notification.cy.tsx | 6 +-- .../e2e/{ => full-mode}/profil.picture.cy.tsx | 2 +- cypress/e2e/{ => full-mode}/profile.cy.tsx | 14 +++---- .../e2e/{ => full-mode}/public-link.cy.tsx | 2 +- cypress/e2e/{ => full-mode}/receipt.cy.tsx | 6 +-- .../student.announcements.cy.tsx | 2 +- cypress/e2e/{ => full-mode}/student.cy.tsx | 6 +-- .../e2e/{ => full-mode}/student.docs.cy.tsx | 4 +- .../{ => full-mode}/student.fees.letter.tsx | 0 .../{ => full-mode}/student.fees.mpbs.cy.tsx | 4 +- .../teacher.announcements.cy.tsx | 2 +- .../e2e/{ => full-mode}/teacher.course.cy.tsx | 10 ++--- cypress/e2e/{ => full-mode}/teacher.cy.tsx | 4 +- 52 files changed, 178 insertions(+), 127 deletions(-) create mode 100644 cypress/e2e/fees-only/fees-only.cy.js rename cypress/e2e/{ => full-mode}/admin.docs.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/admin.staff.cy.ts (97%) rename cypress/e2e/{ => full-mode}/admin.welcome.cy.tsx (91%) rename cypress/e2e/{ => full-mode}/authentification.cy.tsx (84%) rename cypress/e2e/{ => full-mode}/certificate.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/comments.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/cor.manager.cy.ts (96%) rename cypress/e2e/{ => full-mode}/download.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/event.manager.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/event.student.cy.tsx (98%) rename cypress/e2e/{ => full-mode}/event.teacher.cy.tsx (98%) rename cypress/e2e/{ => full-mode}/exam.card.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/exam.participant.list.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/function.cy.ts (100%) rename cypress/e2e/{ => full-mode}/grade-overview.cy.ts (98%) rename cypress/e2e/{ => full-mode}/grades.components.cy.tsx (98%) rename cypress/e2e/{ => full-mode}/helpers.cy.ts (100%) rename cypress/e2e/{ => full-mode}/importConf.cy.ts (100%) rename cypress/e2e/{ => full-mode}/letter.event.cy.tsx (88%) rename cypress/e2e/{ => full-mode}/letters.manager.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/letters.users.cy.tsx (94%) rename cypress/e2e/{ => full-mode}/manager.announcements.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.course.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/manager.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.docs.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/manager.fees.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.fees.import.cy.tsx (93%) rename cypress/e2e/{ => full-mode}/manager.fees.mpbs.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.fees.templates.cy.tsx (98%) rename cypress/e2e/{ => full-mode}/manager.groups.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.monitor.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/manager.payments.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.promotions.cy.tsx (98%) rename cypress/e2e/{ => full-mode}/manager.students.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/manager.teachers.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/manager.teachers.import.cy.tsx (94%) rename cypress/e2e/{ => full-mode}/monitor.cy.tsx (88%) rename cypress/e2e/{ => full-mode}/notification.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/profil.picture.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/profile.cy.tsx (91%) rename cypress/e2e/{ => full-mode}/public-link.cy.tsx (97%) rename cypress/e2e/{ => full-mode}/receipt.cy.tsx (95%) rename cypress/e2e/{ => full-mode}/student.announcements.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/student.cy.tsx (93%) rename cypress/e2e/{ => full-mode}/student.docs.cy.tsx (96%) rename cypress/e2e/{ => full-mode}/student.fees.letter.tsx (100%) rename cypress/e2e/{ => full-mode}/student.fees.mpbs.cy.tsx (94%) rename cypress/e2e/{ => full-mode}/teacher.announcements.cy.tsx (94%) rename cypress/e2e/{ => full-mode}/teacher.course.cy.tsx (68%) rename cypress/e2e/{ => full-mode}/teacher.cy.tsx (95%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b17bd777..3d3b3b784 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,12 +114,25 @@ jobs: file: version.yml version: version - ## Run Cypress e2e tests ## - - name: Run e2e tests + ## Run Cypress e2e tests (full mode) ## + - name: Run e2e tests (full mode) uses: cypress-io/github-action@v6 with: start: npm run dev - command: npx cypress run --env coverage=true + wait-on: "http://localhost:5173" + command: npx cypress run --env coverage=true --spec "cypress/e2e/{full-mode,shared}/**/*.cy.js" + env: + REACT_APP_FEES_ONLY: "false" + + ## Run Cypress e2e tests (fees-only mode) ## + - name: Run e2e tests (fees-only mode) + uses: cypress-io/github-action@v6 + with: + start: npm run dev + wait-on: "http://localhost:5173" + command: npx cypress run --env coverage=true --spec "cypress/e2e/fees-only/**/*.cy.js" + env: + REACT_APP_FEES_ONLY: "true" ## Generate Lcov report ## - name: Generate Lcov report @@ -182,4 +195,4 @@ jobs: ## Build the application with vite and typescript ## - name: Build app - run: npm run build + run: npm run build \ No newline at end of file diff --git a/cypress/e2e/fees-only/fees-only.cy.js b/cypress/e2e/fees-only/fees-only.cy.js new file mode 100644 index 000000000..72af13f0a --- /dev/null +++ b/cypress/e2e/fees-only/fees-only.cy.js @@ -0,0 +1,38 @@ +describe("Fees-only mode (REACT_APP_FEES_ONLY=true)", () => { + beforeEach(() => { + cy.login("test.user@mail.com"); + cy.visit("/"); + }); + + it("hides restricted navigation items", () => { + cy.get('[data-testid="sidebar"]').should("not.exist"); + }); + + it("allows access to the fees page", () => { + cy.intercept("GET", "**/fees*", { + statusCode: 200, + body: [], + }).as("getFees"); + cy.visit("/fees"); + cy.wait("@getFees").its("response.statusCode").should("eq", 200); + cy.get('[data-testid="fees-table"]').should("be.visible"); + }); + + it("blocks access to restricted features", () => { + cy.intercept("GET", "**/teachers*", { + statusCode: 400, + body: { + error: "Bad Request: feature disabled in fees-only mode", + }, + }).as("getTeachers"); + cy.visit("/teachers"); + cy.wait("@getTeachers").its("response.statusCode").should("eq", 400); + cy.get('[data-testid="error-message"]').should("be.visible"); + cy.get('[data-testid="teachers-table"]').should("not.exist"); + }); + + it("prevents direct navigation to restricted routes", () => { + cy.visit("/teachers"); + cy.url().should("not.include", "/teachers"); + }); +}); \ No newline at end of file diff --git a/cypress/e2e/admin.docs.cy.tsx b/cypress/e2e/full-mode/admin.docs.cy.tsx similarity index 95% rename from cypress/e2e/admin.docs.cy.tsx rename to cypress/e2e/full-mode/admin.docs.cy.tsx index 347b22dfa..a712de34f 100644 --- a/cypress/e2e/admin.docs.cy.tsx +++ b/cypress/e2e/full-mode/admin.docs.cy.tsx @@ -3,10 +3,10 @@ import { newOtherrDoc, otherDocsMocks, transcriptsMock, -} from "../fixtures/api_mocks/docs-mocks"; -import {monitor1Mock} from "../fixtures/api_mocks/monitors-mock"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; -import {teacher1Mock, teachersMock} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/docs-mocks"; +import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; +import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Admin Teacher Doc", () => { beforeEach(() => { diff --git a/cypress/e2e/admin.staff.cy.ts b/cypress/e2e/full-mode/admin.staff.cy.ts similarity index 97% rename from cypress/e2e/admin.staff.cy.ts rename to cypress/e2e/full-mode/admin.staff.cy.ts index 99285df14..ab54abb65 100644 --- a/cypress/e2e/admin.staff.cy.ts +++ b/cypress/e2e/full-mode/admin.staff.cy.ts @@ -1,10 +1,10 @@ import {StaffMember, WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {lettersMocks, statsMocks} from "../fixtures/api_mocks/letters-mocks"; +import {lettersMocks, statsMocks} from "../../fixtures/api_mocks/letters-mocks"; import { staffCreatedMock, staffMock, staffUpdatedMock, -} from "../fixtures/api_mocks/staffs-mock"; +} from "../../fixtures/api_mocks/staffs-mock"; describe("Admin Staff", () => { beforeEach(() => { diff --git a/cypress/e2e/admin.welcome.cy.tsx b/cypress/e2e/full-mode/admin.welcome.cy.tsx similarity index 91% rename from cypress/e2e/admin.welcome.cy.tsx rename to cypress/e2e/full-mode/admin.welcome.cy.tsx index 8ceb2bcac..a30316158 100644 --- a/cypress/e2e/admin.welcome.cy.tsx +++ b/cypress/e2e/full-mode/admin.welcome.cy.tsx @@ -1,12 +1,12 @@ /// import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {advanceStatsMocks} from "../fixtures/api_mocks/advanceStats-mocks"; -import {announcementsMock} from "../fixtures/api_mocks/announcement-mocks"; -import {commentMocks} from "../fixtures/api_mocks/comment-mocks"; -import {unpaidFeeMock} from "../fixtures/api_mocks/fees-mocks"; -import {lettersMocks, statsMocks} from "../fixtures/api_mocks/letters-mocks"; -import {studentsMock} from "../fixtures/api_mocks/students-mocks"; +import {advanceStatsMocks} from "../../fixtures/api_mocks/advanceStats-mocks"; +import {announcementsMock} from "../../fixtures/api_mocks/announcement-mocks"; +import {commentMocks} from "../../fixtures/api_mocks/comment-mocks"; +import {unpaidFeeMock} from "../../fixtures/api_mocks/fees-mocks"; +import {lettersMocks, statsMocks} from "../../fixtures/api_mocks/letters-mocks"; +import {studentsMock} from "../../fixtures/api_mocks/students-mocks"; const ITEM_PER_LIST = 12; diff --git a/cypress/e2e/authentification.cy.tsx b/cypress/e2e/full-mode/authentification.cy.tsx similarity index 84% rename from cypress/e2e/authentification.cy.tsx rename to cypress/e2e/full-mode/authentification.cy.tsx index 8ff25ff37..a1d56f001 100644 --- a/cypress/e2e/authentification.cy.tsx +++ b/cypress/e2e/full-mode/authentification.cy.tsx @@ -1,4 +1,4 @@ -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; describe("Authentification", () => { it("should lands on profile page if succeeds", () => { diff --git a/cypress/e2e/certificate.cy.tsx b/cypress/e2e/full-mode/certificate.cy.tsx similarity index 96% rename from cypress/e2e/certificate.cy.tsx rename to cypress/e2e/full-mode/certificate.cy.tsx index 557e92792..73a3bce91 100644 --- a/cypress/e2e/certificate.cy.tsx +++ b/cypress/e2e/full-mode/certificate.cy.tsx @@ -1,4 +1,4 @@ -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; const MESSAGE_ERROR = "Échec de téléchargement. Veuillez réessayer"; describe("Student Ceritificate", () => { diff --git a/cypress/e2e/comments.cy.tsx b/cypress/e2e/full-mode/comments.cy.tsx similarity index 95% rename from cypress/e2e/comments.cy.tsx rename to cypress/e2e/full-mode/comments.cy.tsx index 9e9399e2d..be8e6abbb 100644 --- a/cypress/e2e/comments.cy.tsx +++ b/cypress/e2e/full-mode/comments.cy.tsx @@ -1,8 +1,8 @@ import { commentMocks, student1CommentMocks, -} from "../fixtures/api_mocks/comment-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/comment-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; const ITEM_PER_LIST = 12; const ITEM_PER_LIST2 = 13; diff --git a/cypress/e2e/cor.manager.cy.ts b/cypress/e2e/full-mode/cor.manager.cy.ts similarity index 96% rename from cypress/e2e/cor.manager.cy.ts rename to cypress/e2e/full-mode/cor.manager.cy.ts index b451736b0..2fc3ab290 100644 --- a/cypress/e2e/cor.manager.cy.ts +++ b/cypress/e2e/full-mode/cor.manager.cy.ts @@ -1,8 +1,8 @@ import {formatDate} from "@/utils/date"; import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {corMock, corMock1} from "../fixtures/api_mocks/cor-mock"; -import {studentsMock} from "../fixtures/api_mocks/students-mocks"; -import {teachersMock} from "../fixtures/api_mocks/teachers-mocks"; +import {corMock, corMock1} from "../../fixtures/api_mocks/cor-mock"; +import {studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import {teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Cor Manager", () => { beforeEach(() => { diff --git a/cypress/e2e/download.cy.tsx b/cypress/e2e/full-mode/download.cy.tsx similarity index 97% rename from cypress/e2e/download.cy.tsx rename to cypress/e2e/full-mode/download.cy.tsx index f5fdd9dd7..c39ffada9 100644 --- a/cypress/e2e/download.cy.tsx +++ b/cypress/e2e/full-mode/download.cy.tsx @@ -6,8 +6,8 @@ import { transcriptsMock, workDoc1, workDocsMocks, -} from "../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/docs-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Manager.Work.Docs.Download", () => { beforeEach(() => { diff --git a/cypress/e2e/event.manager.cy.tsx b/cypress/e2e/full-mode/event.manager.cy.tsx similarity index 95% rename from cypress/e2e/event.manager.cy.tsx rename to cypress/e2e/full-mode/event.manager.cy.tsx index 588e79464..641f9709c 100644 --- a/cypress/e2e/event.manager.cy.tsx +++ b/cypress/e2e/full-mode/event.manager.cy.tsx @@ -1,13 +1,13 @@ import {EVENT_TYPE_VALUE} from "@/operations/events/utils"; -import {courseMocks} from "../fixtures/api_mocks/course-mocks"; +import {courseMocks} from "../../fixtures/api_mocks/course-mocks"; import { event1mock, eventparticipant1mock, eventParticipantsMock, eventsMock, -} from "../fixtures/api_mocks/event-mocks"; -import {groupsMock} from "../fixtures/api_mocks/groups-mocks"; -import {missingParticipantsMock} from "../fixtures/api_mocks/missing-participants-mock"; +} from "../../fixtures/api_mocks/event-mocks"; +import {groupsMock} from "../../fixtures/api_mocks/groups-mocks"; +import {missingParticipantsMock} from "../../fixtures/api_mocks/missing-participants-mock"; describe("Manager.event", () => { beforeEach(() => { diff --git a/cypress/e2e/event.student.cy.tsx b/cypress/e2e/full-mode/event.student.cy.tsx similarity index 98% rename from cypress/e2e/event.student.cy.tsx rename to cypress/e2e/full-mode/event.student.cy.tsx index cf8680111..cf8991525 100644 --- a/cypress/e2e/event.student.cy.tsx +++ b/cypress/e2e/full-mode/event.student.cy.tsx @@ -1,13 +1,13 @@ import { calendarMock, nextcalendarMock, -} from "../fixtures/api_mocks/calendar-mock"; +} from "../../fixtures/api_mocks/calendar-mock"; import { event1mock, eventparticipant1mock, eventParticipantsMock, eventsMock, -} from "../fixtures/api_mocks/event-mocks"; +} from "../../fixtures/api_mocks/event-mocks"; describe("Student.event", () => { beforeEach(() => { diff --git a/cypress/e2e/event.teacher.cy.tsx b/cypress/e2e/full-mode/event.teacher.cy.tsx similarity index 98% rename from cypress/e2e/event.teacher.cy.tsx rename to cypress/e2e/full-mode/event.teacher.cy.tsx index 26528049e..cb5088b6e 100644 --- a/cypress/e2e/event.teacher.cy.tsx +++ b/cypress/e2e/full-mode/event.teacher.cy.tsx @@ -3,7 +3,7 @@ import { eventparticipant1mock, eventParticipantsMock, eventsMock, -} from "../fixtures/api_mocks/event-mocks"; +} from "../../fixtures/api_mocks/event-mocks"; describe("Teacher.event", () => { beforeEach(() => { diff --git a/cypress/e2e/exam.card.cy.tsx b/cypress/e2e/full-mode/exam.card.cy.tsx similarity index 97% rename from cypress/e2e/exam.card.cy.tsx rename to cypress/e2e/full-mode/exam.card.cy.tsx index 1095af718..9ada48db4 100644 --- a/cypress/e2e/exam.card.cy.tsx +++ b/cypress/e2e/full-mode/exam.card.cy.tsx @@ -1,6 +1,6 @@ import {formatDate} from "@/utils/date"; import {Exam} from "@haapi-b0fc7615/typescript-client"; -import {examMocks, gradesMocks} from "../fixtures/api_mocks/exam-mocks"; +import {examMocks, gradesMocks} from "../../fixtures/api_mocks/exam-mocks"; const baseExam: Exam = { id: "exam-001", diff --git a/cypress/e2e/exam.participant.list.cy.tsx b/cypress/e2e/full-mode/exam.participant.list.cy.tsx similarity index 96% rename from cypress/e2e/exam.participant.list.cy.tsx rename to cypress/e2e/full-mode/exam.participant.list.cy.tsx index 2e2037e9b..80d64ea43 100644 --- a/cypress/e2e/exam.participant.list.cy.tsx +++ b/cypress/e2e/full-mode/exam.participant.list.cy.tsx @@ -1,14 +1,14 @@ import {formatDate} from "@/utils/date"; import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {courseMocks} from "../fixtures/api_mocks/course-mocks"; +import {courseMocks} from "../../fixtures/api_mocks/course-mocks"; import { courseAssignmentMocks, examCreateMock, examMocks, examMocksfiltered, -} from "../fixtures/api_mocks/exam-mocks"; -import {group1Mock, groupsMock} from "../fixtures/api_mocks/groups-mocks"; -import {teachersMock} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/exam-mocks"; +import {group1Mock, groupsMock} from "../../fixtures/api_mocks/groups-mocks"; +import {teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; const pageAssertions = () => { cy.contains("Liste des examens").should("be.visible"); diff --git a/cypress/e2e/function.cy.ts b/cypress/e2e/full-mode/function.cy.ts similarity index 100% rename from cypress/e2e/function.cy.ts rename to cypress/e2e/full-mode/function.cy.ts diff --git a/cypress/e2e/grade-overview.cy.ts b/cypress/e2e/full-mode/grade-overview.cy.ts similarity index 98% rename from cypress/e2e/grade-overview.cy.ts rename to cypress/e2e/full-mode/grade-overview.cy.ts index 8f9480913..3e2ddcadf 100644 --- a/cypress/e2e/grade-overview.cy.ts +++ b/cypress/e2e/full-mode/grade-overview.cy.ts @@ -5,10 +5,10 @@ import { yearlyResultL2Mock, yearlyResultL3Mock, yearlyResultMock, -} from "../fixtures/api_mocks/grades-mocks"; -import {monitor1Mock} from "../fixtures/api_mocks/monitors-mock"; -import {studentLinkedToMonitorMock} from "../fixtures/api_mocks/students-mocks"; -import {summaryResultMocks} from "../fixtures/api_mocks/summary-result-mocks"; +} from "../../fixtures/api_mocks/grades-mocks"; +import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; +import {studentLinkedToMonitorMock} from "../../fixtures/api_mocks/students-mocks"; +import {summaryResultMocks} from "../../fixtures/api_mocks/summary-result-mocks"; describe("All View", () => { beforeEach(() => { diff --git a/cypress/e2e/grades.components.cy.tsx b/cypress/e2e/full-mode/grades.components.cy.tsx similarity index 98% rename from cypress/e2e/grades.components.cy.tsx rename to cypress/e2e/full-mode/grades.components.cy.tsx index db1e1e8cb..5428ff446 100644 --- a/cypress/e2e/grades.components.cy.tsx +++ b/cypress/e2e/full-mode/grades.components.cy.tsx @@ -6,9 +6,9 @@ import { yearlyResultL2Mock, yearlyResultL3Mock, yearlyResultMock, -} from "../fixtures/api_mocks/grades-mocks"; -import {monitor1Mock} from "../fixtures/api_mocks/monitors-mock"; -import {studentLinkedToMonitorMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/grades-mocks"; +import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; +import {studentLinkedToMonitorMock} from "../../fixtures/api_mocks/students-mocks"; const goToStudentGrades = () => { cy.intercept( diff --git a/cypress/e2e/helpers.cy.ts b/cypress/e2e/full-mode/helpers.cy.ts similarity index 100% rename from cypress/e2e/helpers.cy.ts rename to cypress/e2e/full-mode/helpers.cy.ts diff --git a/cypress/e2e/importConf.cy.ts b/cypress/e2e/full-mode/importConf.cy.ts similarity index 100% rename from cypress/e2e/importConf.cy.ts rename to cypress/e2e/full-mode/importConf.cy.ts diff --git a/cypress/e2e/letter.event.cy.tsx b/cypress/e2e/full-mode/letter.event.cy.tsx similarity index 88% rename from cypress/e2e/letter.event.cy.tsx rename to cypress/e2e/full-mode/letter.event.cy.tsx index ed7c8fe79..828ac4890 100644 --- a/cypress/e2e/letter.event.cy.tsx +++ b/cypress/e2e/full-mode/letter.event.cy.tsx @@ -1,9 +1,9 @@ import { event1mock, eventParticipantsMock, -} from "../fixtures/api_mocks/event-mocks"; -import {newLetter} from "../fixtures/api_mocks/letters-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/event-mocks"; +import {newLetter} from "../../fixtures/api_mocks/letters-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; describe("Letter.event", () => { beforeEach(() => { diff --git a/cypress/e2e/letters.manager.cy.tsx b/cypress/e2e/full-mode/letters.manager.cy.tsx similarity index 97% rename from cypress/e2e/letters.manager.cy.tsx rename to cypress/e2e/full-mode/letters.manager.cy.tsx index e566312b7..9a35d75e1 100644 --- a/cypress/e2e/letters.manager.cy.tsx +++ b/cypress/e2e/full-mode/letters.manager.cy.tsx @@ -3,8 +3,8 @@ import { newLetter2, statsMocks, student1LettersMocks, -} from "../fixtures/api_mocks/letters-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/letters-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; const ITEM_PER_LIST = 12; diff --git a/cypress/e2e/letters.users.cy.tsx b/cypress/e2e/full-mode/letters.users.cy.tsx similarity index 94% rename from cypress/e2e/letters.users.cy.tsx rename to cypress/e2e/full-mode/letters.users.cy.tsx index 57f8bc326..40cc5b5eb 100644 --- a/cypress/e2e/letters.users.cy.tsx +++ b/cypress/e2e/full-mode/letters.users.cy.tsx @@ -2,9 +2,9 @@ import { newLetter, student1LettersMocks, teacher1LettersMocks, -} from "../fixtures/api_mocks/letters-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; -import {teacher1Mock} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/letters-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; const ITEM_PER_LIST = 12; diff --git a/cypress/e2e/manager.announcements.cy.tsx b/cypress/e2e/full-mode/manager.announcements.cy.tsx similarity index 96% rename from cypress/e2e/manager.announcements.cy.tsx rename to cypress/e2e/full-mode/manager.announcements.cy.tsx index 0bf8f99c5..9d23bb6b9 100644 --- a/cypress/e2e/manager.announcements.cy.tsx +++ b/cypress/e2e/full-mode/manager.announcements.cy.tsx @@ -3,7 +3,7 @@ import { announcementCreate, announcementsMock, createdAnnouncement, -} from "../fixtures/api_mocks/announcement-mocks"; +} from "../../fixtures/api_mocks/announcement-mocks"; describe("Manager announcements", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.course.cy.tsx b/cypress/e2e/full-mode/manager.course.cy.tsx similarity index 95% rename from cypress/e2e/manager.course.cy.tsx rename to cypress/e2e/full-mode/manager.course.cy.tsx index 3104bc01f..18e0d4392 100644 --- a/cypress/e2e/manager.course.cy.tsx +++ b/cypress/e2e/full-mode/manager.course.cy.tsx @@ -2,10 +2,10 @@ import {Course} from "@haapi-b0fc7615/typescript-client"; import { CourseAssignment1Mock, createCourseAssignment, -} from "../fixtures/api_mocks/course-assignment-mocks"; -import {courseMock1, courseMocks} from "../fixtures/api_mocks/course-mocks"; -import {groupsMock} from "../fixtures/api_mocks/groups-mocks"; -import {teacher1Mock, teachersMock} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/course-assignment-mocks"; +import {courseMock1, courseMocks} from "../../fixtures/api_mocks/course-mocks"; +import {groupsMock} from "../../fixtures/api_mocks/groups-mocks"; +import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; const NEW_COURSE: Required = { ...courseMock1, diff --git a/cypress/e2e/manager.cy.tsx b/cypress/e2e/full-mode/manager.cy.tsx similarity index 96% rename from cypress/e2e/manager.cy.tsx rename to cypress/e2e/full-mode/manager.cy.tsx index 012e656ae..145e95d07 100644 --- a/cypress/e2e/manager.cy.tsx +++ b/cypress/e2e/full-mode/manager.cy.tsx @@ -1,14 +1,14 @@ -import {manager1Mock} from "../fixtures/api_mocks/managers-mocks"; +import {manager1Mock} from "../../fixtures/api_mocks/managers-mocks"; import { createStudent, student1Mock, studentsMock, -} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/students-mocks"; import { teacher1Mock, teacherNameToBeCheckedMock, teachersMock, -} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/teachers-mocks"; const newLastname = "Aina herilala"; let createdStudent = { diff --git a/cypress/e2e/manager.docs.cy.tsx b/cypress/e2e/full-mode/manager.docs.cy.tsx similarity index 97% rename from cypress/e2e/manager.docs.cy.tsx rename to cypress/e2e/full-mode/manager.docs.cy.tsx index ceac4180a..54d326d73 100644 --- a/cypress/e2e/manager.docs.cy.tsx +++ b/cypress/e2e/full-mode/manager.docs.cy.tsx @@ -8,8 +8,8 @@ import { transcriptsMock, workDoc1, workDocsMocks, -} from "../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/docs-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Manager.Transcript.Docs", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.fees.cy.tsx b/cypress/e2e/full-mode/manager.fees.cy.tsx similarity index 96% rename from cypress/e2e/manager.fees.cy.tsx rename to cypress/e2e/full-mode/manager.fees.cy.tsx index 584656742..68e6c3630 100644 --- a/cypress/e2e/manager.fees.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.cy.tsx @@ -1,13 +1,13 @@ import {FeeTypeEnum} from "@haapi-b0fc7615/typescript-client"; -import {fee1Mock, feesMock} from "../fixtures/api_mocks/fees-mocks"; +import {fee1Mock, feesMock} from "../../fixtures/api_mocks/fees-mocks"; import { annual1xTemplate, annual9xTemplate, feesTemplatesMocks, -} from "../fixtures/api_mocks/fees-templates-mocks"; -import {createPaymentMock} from "../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; -import {assertFeeMatchesTemplate} from "./utils"; +} from "../../fixtures/api_mocks/fees-templates-mocks"; +import {createPaymentMock} from "../../fixtures/api_mocks/payments-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import {assertFeeMatchesTemplate} from "../utils"; /*Added this to make the test blackbox */ const get27thOfMonth = (year: number, month: number) => { diff --git a/cypress/e2e/manager.fees.import.cy.tsx b/cypress/e2e/full-mode/manager.fees.import.cy.tsx similarity index 93% rename from cypress/e2e/manager.fees.import.cy.tsx rename to cypress/e2e/full-mode/manager.fees.import.cy.tsx index 60917ea00..b3c63690e 100644 --- a/cypress/e2e/manager.fees.import.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.import.cy.tsx @@ -1,7 +1,7 @@ -import {feesMock} from "../fixtures/api_mocks/fees-mocks"; -import {statsMocks} from "../fixtures/api_mocks/letters-mocks"; -import {manager1Mock} from "../fixtures/api_mocks/managers-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +import {feesMock} from "../../fixtures/api_mocks/fees-mocks"; +import {statsMocks} from "../../fixtures/api_mocks/letters-mocks"; +import {manager1Mock} from "../../fixtures/api_mocks/managers-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; type ImportArgs = { file: string; diff --git a/cypress/e2e/manager.fees.mpbs.cy.tsx b/cypress/e2e/full-mode/manager.fees.mpbs.cy.tsx similarity index 96% rename from cypress/e2e/manager.fees.mpbs.cy.tsx rename to cypress/e2e/full-mode/manager.fees.mpbs.cy.tsx index 58552e977..29a21ce1d 100644 --- a/cypress/e2e/manager.fees.mpbs.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.mpbs.cy.tsx @@ -3,8 +3,8 @@ import { feesMpbsMock, pendingMpbs, succeedMpbs1, -} from "../fixtures/api_mocks/fees-mocks"; -import {advancedStats} from "../fixtures/api_mocks/fees-stats"; +} from "../../fixtures/api_mocks/fees-mocks"; +import {advancedStats} from "../../fixtures/api_mocks/fees-stats"; describe("Mobile payment by student", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.fees.templates.cy.tsx b/cypress/e2e/full-mode/manager.fees.templates.cy.tsx similarity index 98% rename from cypress/e2e/manager.fees.templates.cy.tsx rename to cypress/e2e/full-mode/manager.fees.templates.cy.tsx index 78098ae08..a5140ec80 100644 --- a/cypress/e2e/manager.fees.templates.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.templates.cy.tsx @@ -2,7 +2,7 @@ import {FeeTemplate} from "@haapi-b0fc7615/typescript-client"; import { feesTemplates1Mock, feesTemplatesMocks, -} from "../fixtures/api_mocks/fees-templates-mocks"; +} from "../../fixtures/api_mocks/fees-templates-mocks"; const feesTemplate1Updated: Required = { ...feesTemplates1Mock, diff --git a/cypress/e2e/manager.groups.cy.tsx b/cypress/e2e/full-mode/manager.groups.cy.tsx similarity index 96% rename from cypress/e2e/manager.groups.cy.tsx rename to cypress/e2e/full-mode/manager.groups.cy.tsx index 41e3e2b1e..b92369f56 100644 --- a/cypress/e2e/manager.groups.cy.tsx +++ b/cypress/e2e/full-mode/manager.groups.cy.tsx @@ -7,8 +7,8 @@ import { groupsMock, leaveGroupFlow, moveGroupFlow, -} from "../fixtures/api_mocks/groups-mocks"; -import {studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/groups-mocks"; +import {studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Manager.Group", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.monitor.cy.tsx b/cypress/e2e/full-mode/manager.monitor.cy.tsx similarity index 95% rename from cypress/e2e/manager.monitor.cy.tsx rename to cypress/e2e/full-mode/manager.monitor.cy.tsx index 63477e599..b4c8cfb5d 100644 --- a/cypress/e2e/manager.monitor.cy.tsx +++ b/cypress/e2e/full-mode/manager.monitor.cy.tsx @@ -2,9 +2,9 @@ import { createdMonitor, monitor1Mock, monitorsMock, -} from "../fixtures/api_mocks/monitors-mock"; -import {studentsMock} from "../fixtures/api_mocks/students-mocks"; -import {updatedInfo} from "./utils"; +} from "../../fixtures/api_mocks/monitors-mock"; +import {studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import {updatedInfo} from "../utils"; describe("Manager.Monitors", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.payments.cy.tsx b/cypress/e2e/full-mode/manager.payments.cy.tsx similarity index 96% rename from cypress/e2e/manager.payments.cy.tsx rename to cypress/e2e/full-mode/manager.payments.cy.tsx index de6e50d5c..b1adc7ffc 100644 --- a/cypress/e2e/manager.payments.cy.tsx +++ b/cypress/e2e/full-mode/manager.payments.cy.tsx @@ -4,12 +4,12 @@ import { feesMock, feesMpbsMock, unpaidFeeMock, -} from "../fixtures/api_mocks/fees-mocks"; +} from "../../fixtures/api_mocks/fees-mocks"; import { createPaymentWithAmountMock, payment1Mock, -} from "../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/payments-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; const amount = 1 + Math.floor(Math.random() * 100_000); const createPayment = createPaymentWithAmountMock(amount); diff --git a/cypress/e2e/manager.promotions.cy.tsx b/cypress/e2e/full-mode/manager.promotions.cy.tsx similarity index 98% rename from cypress/e2e/manager.promotions.cy.tsx rename to cypress/e2e/full-mode/manager.promotions.cy.tsx index dfb2ddb24..bf0de9f11 100644 --- a/cypress/e2e/manager.promotions.cy.tsx +++ b/cypress/e2e/full-mode/manager.promotions.cy.tsx @@ -3,11 +3,11 @@ import { CrupdatePromotion, UpdatePromotionSGroup, } from "@haapi-b0fc7615/typescript-client"; -import {groupsMock} from "../fixtures/api_mocks/groups-mocks"; +import {groupsMock} from "../../fixtures/api_mocks/groups-mocks"; import { promotion1Mock, promotionsMock, -} from "../fixtures/api_mocks/promotions-mocks"; +} from "../../fixtures/api_mocks/promotions-mocks"; const promotion2Mock = promotionsMock[1]; diff --git a/cypress/e2e/manager.students.cy.tsx b/cypress/e2e/full-mode/manager.students.cy.tsx similarity index 97% rename from cypress/e2e/manager.students.cy.tsx rename to cypress/e2e/full-mode/manager.students.cy.tsx index bfacd3d25..a89c360ba 100644 --- a/cypress/e2e/manager.students.cy.tsx +++ b/cypress/e2e/full-mode/manager.students.cy.tsx @@ -1,25 +1,25 @@ import {FeeTypeEnum} from "@haapi-b0fc7615/typescript-client"; -import {createdFeesForNewStudent} from "../fixtures/api_mocks/fees-mocks"; +import {createdFeesForNewStudent} from "../../fixtures/api_mocks/fees-mocks"; import { annual1xTemplate, annual9xTemplate, feesTemplatesMocks, -} from "../fixtures/api_mocks/fees-templates-mocks"; +} from "../../fixtures/api_mocks/fees-templates-mocks"; import { createStudent, liteCreatedStudent, student1Mock, studentsMock, -} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/students-mocks"; import { teacher1Mock, teacherNameToBeCheckedMock, teachersMock, -} from "../fixtures/api_mocks/teachers-mocks"; +} from "../../fixtures/api_mocks/teachers-mocks"; import { assertFeeMatchesTemplate, studentRequestBodyVerification, -} from "./utils"; +} from "../utils"; const newFirstName = "Aina herilala"; let createdStudent = { diff --git a/cypress/e2e/manager.teachers.cy.tsx b/cypress/e2e/full-mode/manager.teachers.cy.tsx similarity index 96% rename from cypress/e2e/manager.teachers.cy.tsx rename to cypress/e2e/full-mode/manager.teachers.cy.tsx index 02ef1ffac..99a71f0b6 100644 --- a/cypress/e2e/manager.teachers.cy.tsx +++ b/cypress/e2e/full-mode/manager.teachers.cy.tsx @@ -1,5 +1,5 @@ -import {teacher1Mock, teachersMock} from "../fixtures/api_mocks/teachers-mocks"; -import {updatedInfo} from "./utils"; +import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; +import {updatedInfo} from "../utils"; describe("Manager.Teachers", () => { beforeEach(() => { diff --git a/cypress/e2e/manager.teachers.import.cy.tsx b/cypress/e2e/full-mode/manager.teachers.import.cy.tsx similarity index 94% rename from cypress/e2e/manager.teachers.import.cy.tsx rename to cypress/e2e/full-mode/manager.teachers.import.cy.tsx index 1c3e455dd..9071c6692 100644 --- a/cypress/e2e/manager.teachers.import.cy.tsx +++ b/cypress/e2e/full-mode/manager.teachers.import.cy.tsx @@ -1,11 +1,11 @@ -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; import { createdTeachers, liteCreatedTeachers, teacherNameToBeCheckedMock, teachersMock, -} from "../fixtures/api_mocks/teachers-mocks"; -import {importFile} from "./utils"; +} from "../../fixtures/api_mocks/teachers-mocks"; +import {importFile} from "../utils"; const _path = "cypress/fixtures/teachers_import"; describe("Manager create multiple teachers", () => { diff --git a/cypress/e2e/monitor.cy.tsx b/cypress/e2e/full-mode/monitor.cy.tsx similarity index 88% rename from cypress/e2e/monitor.cy.tsx rename to cypress/e2e/full-mode/monitor.cy.tsx index fb010da3d..70902e453 100644 --- a/cypress/e2e/monitor.cy.tsx +++ b/cypress/e2e/full-mode/monitor.cy.tsx @@ -1,5 +1,5 @@ -import {monitor1Mock} from "../fixtures/api_mocks/monitors-mock"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Monitors", () => { beforeEach(() => { diff --git a/cypress/e2e/notification.cy.tsx b/cypress/e2e/full-mode/notification.cy.tsx similarity index 96% rename from cypress/e2e/notification.cy.tsx rename to cypress/e2e/full-mode/notification.cy.tsx index 52fa5a309..e30649e75 100644 --- a/cypress/e2e/notification.cy.tsx +++ b/cypress/e2e/full-mode/notification.cy.tsx @@ -2,13 +2,13 @@ import { createStudent, student1Mock, studentsMock, -} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/students-mocks"; import { teacher1Mock, teacherNameToBeCheckedMock, teachersMock, -} from "../fixtures/api_mocks/teachers-mocks"; -import {updatedInfo} from "./utils"; +} from "../../fixtures/api_mocks/teachers-mocks"; +import {updatedInfo} from "../utils"; let createdStudent = { ...createStudent, diff --git a/cypress/e2e/profil.picture.cy.tsx b/cypress/e2e/full-mode/profil.picture.cy.tsx similarity index 97% rename from cypress/e2e/profil.picture.cy.tsx rename to cypress/e2e/full-mode/profil.picture.cy.tsx index aadff26ec..736db6079 100644 --- a/cypress/e2e/profil.picture.cy.tsx +++ b/cypress/e2e/full-mode/profil.picture.cy.tsx @@ -2,7 +2,7 @@ import { badPicManager, updatedManager, withPicManager, -} from "../fixtures/api_mocks/profil-mocks"; +} from "../../fixtures/api_mocks/profil-mocks"; describe("Profile picture test", () => { it("should fallback to default source when profile_pic is falsy", () => { diff --git a/cypress/e2e/profile.cy.tsx b/cypress/e2e/full-mode/profile.cy.tsx similarity index 91% rename from cypress/e2e/profile.cy.tsx rename to cypress/e2e/full-mode/profile.cy.tsx index 7438b169f..4566f192f 100644 --- a/cypress/e2e/profile.cy.tsx +++ b/cypress/e2e/full-mode/profile.cy.tsx @@ -1,11 +1,11 @@ import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {admin1Mock} from "../fixtures/api_mocks/admins-mock"; -import {manager1Mock} from "../fixtures/api_mocks/managers-mocks"; -import {monitor1Mock} from "../fixtures/api_mocks/monitors-mock"; -import {organizer1Mock} from "../fixtures/api_mocks/organizers-mock"; -import {staff1Mock} from "../fixtures/api_mocks/staffs-mock"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; -import {teacher1Mock} from "../fixtures/api_mocks/teachers-mocks"; +import {admin1Mock} from "../../fixtures/api_mocks/admins-mock"; +import {manager1Mock} from "../../fixtures/api_mocks/managers-mocks"; +import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; +import {organizer1Mock} from "../../fixtures/api_mocks/organizers-mock"; +import {staff1Mock} from "../../fixtures/api_mocks/staffs-mock"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; +import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Admin profile test", () => { beforeEach(() => { diff --git a/cypress/e2e/public-link.cy.tsx b/cypress/e2e/full-mode/public-link.cy.tsx similarity index 97% rename from cypress/e2e/public-link.cy.tsx rename to cypress/e2e/full-mode/public-link.cy.tsx index 51b14f860..3518eb22e 100644 --- a/cypress/e2e/public-link.cy.tsx +++ b/cypress/e2e/full-mode/public-link.cy.tsx @@ -1,7 +1,7 @@ import { calendarMock, nextcalendarMock, -} from "../fixtures/api_mocks/calendar-mock"; +} from "../../fixtures/api_mocks/calendar-mock"; describe("Aws waf handler", () => { it("should display captcha dialog on status: 405", () => { diff --git a/cypress/e2e/receipt.cy.tsx b/cypress/e2e/full-mode/receipt.cy.tsx similarity index 95% rename from cypress/e2e/receipt.cy.tsx rename to cypress/e2e/full-mode/receipt.cy.tsx index c07fa965c..2cb11e4f3 100644 --- a/cypress/e2e/receipt.cy.tsx +++ b/cypress/e2e/full-mode/receipt.cy.tsx @@ -1,9 +1,9 @@ -import {fee1Mock, feesMock} from "../fixtures/api_mocks/fees-mocks"; +import {fee1Mock, feesMock} from "../../fixtures/api_mocks/fees-mocks"; import { createPaymentMock, payment1Mock, -} from "../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/payments-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Student receipt", () => { beforeEach(() => { diff --git a/cypress/e2e/student.announcements.cy.tsx b/cypress/e2e/full-mode/student.announcements.cy.tsx similarity index 96% rename from cypress/e2e/student.announcements.cy.tsx rename to cypress/e2e/full-mode/student.announcements.cy.tsx index 18a7a5490..3d45cfb6a 100644 --- a/cypress/e2e/student.announcements.cy.tsx +++ b/cypress/e2e/full-mode/student.announcements.cy.tsx @@ -2,7 +2,7 @@ import { announcement1, announcementsMock, createdAnnouncement, -} from "../fixtures/api_mocks/announcement-mocks"; +} from "../../fixtures/api_mocks/announcement-mocks"; describe("Student announcements", () => { beforeEach(() => { diff --git a/cypress/e2e/student.cy.tsx b/cypress/e2e/full-mode/student.cy.tsx similarity index 93% rename from cypress/e2e/student.cy.tsx rename to cypress/e2e/full-mode/student.cy.tsx index 0e37aa635..c6dfa03f5 100644 --- a/cypress/e2e/student.cy.tsx +++ b/cypress/e2e/full-mode/student.cy.tsx @@ -1,6 +1,6 @@ -import {feesMock} from "../fixtures/api_mocks/fees-mocks"; -import {createPaymentMock} from "../fixtures/api_mocks/payments-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +import {feesMock} from "../../fixtures/api_mocks/fees-mocks"; +import {createPaymentMock} from "../../fixtures/api_mocks/payments-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; describe("Student", () => { beforeEach(() => { diff --git a/cypress/e2e/student.docs.cy.tsx b/cypress/e2e/full-mode/student.docs.cy.tsx similarity index 96% rename from cypress/e2e/student.docs.cy.tsx rename to cypress/e2e/full-mode/student.docs.cy.tsx index 5678c6197..5a51d9de6 100644 --- a/cypress/e2e/student.docs.cy.tsx +++ b/cypress/e2e/full-mode/student.docs.cy.tsx @@ -5,8 +5,8 @@ import { transcriptsMock, workDoc1, workDocsMocks, -} from "../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/docs-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; describe("Transcript.Docs", () => { beforeEach(() => { diff --git a/cypress/e2e/student.fees.letter.tsx b/cypress/e2e/full-mode/student.fees.letter.tsx similarity index 100% rename from cypress/e2e/student.fees.letter.tsx rename to cypress/e2e/full-mode/student.fees.letter.tsx diff --git a/cypress/e2e/student.fees.mpbs.cy.tsx b/cypress/e2e/full-mode/student.fees.mpbs.cy.tsx similarity index 94% rename from cypress/e2e/student.fees.mpbs.cy.tsx rename to cypress/e2e/full-mode/student.fees.mpbs.cy.tsx index 05c0e9d33..858bf6598 100644 --- a/cypress/e2e/student.fees.mpbs.cy.tsx +++ b/cypress/e2e/full-mode/student.fees.mpbs.cy.tsx @@ -3,8 +3,8 @@ import { fee1MockMpbs, feesMock, unverifiedMpbsFee, -} from "../fixtures/api_mocks/fees-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/fees-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; describe("Mobile payment by student", () => { beforeEach(() => { diff --git a/cypress/e2e/teacher.announcements.cy.tsx b/cypress/e2e/full-mode/teacher.announcements.cy.tsx similarity index 94% rename from cypress/e2e/teacher.announcements.cy.tsx rename to cypress/e2e/full-mode/teacher.announcements.cy.tsx index 698caf667..c452523ba 100644 --- a/cypress/e2e/teacher.announcements.cy.tsx +++ b/cypress/e2e/full-mode/teacher.announcements.cy.tsx @@ -2,7 +2,7 @@ import { announcement1, announcementsMock, createdAnnouncement, -} from "../fixtures/api_mocks/announcement-mocks"; +} from "../../fixtures/api_mocks/announcement-mocks"; describe("Manager announcements", () => { beforeEach(() => { diff --git a/cypress/e2e/teacher.course.cy.tsx b/cypress/e2e/full-mode/teacher.course.cy.tsx similarity index 68% rename from cypress/e2e/teacher.course.cy.tsx rename to cypress/e2e/full-mode/teacher.course.cy.tsx index 6121914fa..cafbbcf68 100644 --- a/cypress/e2e/teacher.course.cy.tsx +++ b/cypress/e2e/full-mode/teacher.course.cy.tsx @@ -1,8 +1,8 @@ -import {CourseAssignment1Mock} from "../fixtures/api_mocks/course-assignment-mocks"; -import {courseMock1} from "../fixtures/api_mocks/course-mocks"; -import {student1LettersMocks} from "../fixtures/api_mocks/letters-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; -import {teacher1Mock} from "../fixtures/api_mocks/teachers-mocks"; +import {CourseAssignment1Mock} from "../../fixtures/api_mocks/course-assignment-mocks"; +import {courseMock1} from "../../fixtures/api_mocks/course-mocks"; +import {student1LettersMocks} from "../../fixtures/api_mocks/letters-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; +import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Teacher course", () => { beforeEach(() => { diff --git a/cypress/e2e/teacher.cy.tsx b/cypress/e2e/full-mode/teacher.cy.tsx similarity index 95% rename from cypress/e2e/teacher.cy.tsx rename to cypress/e2e/full-mode/teacher.cy.tsx index 199ae0b88..c8b00ce5e 100644 --- a/cypress/e2e/teacher.cy.tsx +++ b/cypress/e2e/full-mode/teacher.cy.tsx @@ -1,5 +1,5 @@ -import {student1Mock, studentsMock} from "../fixtures/api_mocks/students-mocks"; -import {teacher1Mock} from "../fixtures/api_mocks/teachers-mocks"; +import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Teacher", () => { beforeEach(() => { From 66a2b8df622dfd080459996e6766cec55918217f Mon Sep 17 00:00:00 2001 From: Tokiniaina RAKOTOZANANY Date: Wed, 29 Jul 2026 08:56:32 +0300 Subject: [PATCH 2/5] format --- .github/workflows/ci.yml | 2 +- cypress/e2e/fees-only/fees-only.cy.js | 2 +- cypress/e2e/full-mode/admin.docs.cy.tsx | 5 ++++- cypress/e2e/full-mode/certificate.cy.tsx | 5 ++++- cypress/e2e/full-mode/download.cy.tsx | 5 ++++- cypress/e2e/full-mode/grade-overview.cy.ts | 2 +- cypress/e2e/full-mode/letters.users.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.course.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.docs.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.fees.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.fees.import.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.payments.cy.tsx | 5 ++++- cypress/e2e/full-mode/manager.teachers.cy.tsx | 5 ++++- cypress/e2e/full-mode/monitor.cy.tsx | 5 ++++- cypress/e2e/full-mode/receipt.cy.tsx | 5 ++++- cypress/e2e/full-mode/student.docs.cy.tsx | 5 ++++- cypress/e2e/full-mode/teacher.cy.tsx | 5 ++++- 17 files changed, 59 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d3b3b784..e74ef65b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,4 +195,4 @@ jobs: ## Build the application with vite and typescript ## - name: Build app - run: npm run build \ No newline at end of file + run: npm run build diff --git a/cypress/e2e/fees-only/fees-only.cy.js b/cypress/e2e/fees-only/fees-only.cy.js index 72af13f0a..e8f8db91d 100644 --- a/cypress/e2e/fees-only/fees-only.cy.js +++ b/cypress/e2e/fees-only/fees-only.cy.js @@ -35,4 +35,4 @@ describe("Fees-only mode (REACT_APP_FEES_ONLY=true)", () => { cy.visit("/teachers"); cy.url().should("not.include", "/teachers"); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/full-mode/admin.docs.cy.tsx b/cypress/e2e/full-mode/admin.docs.cy.tsx index a712de34f..23c70e67e 100644 --- a/cypress/e2e/full-mode/admin.docs.cy.tsx +++ b/cypress/e2e/full-mode/admin.docs.cy.tsx @@ -6,7 +6,10 @@ import { } from "../../fixtures/api_mocks/docs-mocks"; import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; -import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; +import { + teacher1Mock, + teachersMock, +} from "../../fixtures/api_mocks/teachers-mocks"; describe("Admin Teacher Doc", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/certificate.cy.tsx b/cypress/e2e/full-mode/certificate.cy.tsx index 73a3bce91..dedd7a98f 100644 --- a/cypress/e2e/full-mode/certificate.cy.tsx +++ b/cypress/e2e/full-mode/certificate.cy.tsx @@ -1,4 +1,7 @@ -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; const MESSAGE_ERROR = "Échec de téléchargement. Veuillez réessayer"; describe("Student Ceritificate", () => { diff --git a/cypress/e2e/full-mode/download.cy.tsx b/cypress/e2e/full-mode/download.cy.tsx index c39ffada9..56d925f04 100644 --- a/cypress/e2e/full-mode/download.cy.tsx +++ b/cypress/e2e/full-mode/download.cy.tsx @@ -7,7 +7,10 @@ import { workDoc1, workDocsMocks, } from "../../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; describe("Manager.Work.Docs.Download", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/grade-overview.cy.ts b/cypress/e2e/full-mode/grade-overview.cy.ts index 3e2ddcadf..db4d2fda9 100644 --- a/cypress/e2e/full-mode/grade-overview.cy.ts +++ b/cypress/e2e/full-mode/grade-overview.cy.ts @@ -1,5 +1,4 @@ import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; -import {getCourseStatusLabel} from "../../src/operations/grades/utils/constants"; import { courseResultsMock, yearlyResultL2Mock, @@ -9,6 +8,7 @@ import { import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; import {studentLinkedToMonitorMock} from "../../fixtures/api_mocks/students-mocks"; import {summaryResultMocks} from "../../fixtures/api_mocks/summary-result-mocks"; +import {getCourseStatusLabel} from "../../src/operations/grades/utils/constants"; describe("All View", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/letters.users.cy.tsx b/cypress/e2e/full-mode/letters.users.cy.tsx index 40cc5b5eb..da399e3cb 100644 --- a/cypress/e2e/full-mode/letters.users.cy.tsx +++ b/cypress/e2e/full-mode/letters.users.cy.tsx @@ -3,7 +3,10 @@ import { student1LettersMocks, teacher1LettersMocks, } from "../../fixtures/api_mocks/letters-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; const ITEM_PER_LIST = 12; diff --git a/cypress/e2e/full-mode/manager.course.cy.tsx b/cypress/e2e/full-mode/manager.course.cy.tsx index 18e0d4392..637ccc3cb 100644 --- a/cypress/e2e/full-mode/manager.course.cy.tsx +++ b/cypress/e2e/full-mode/manager.course.cy.tsx @@ -5,7 +5,10 @@ import { } from "../../fixtures/api_mocks/course-assignment-mocks"; import {courseMock1, courseMocks} from "../../fixtures/api_mocks/course-mocks"; import {groupsMock} from "../../fixtures/api_mocks/groups-mocks"; -import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; +import { + teacher1Mock, + teachersMock, +} from "../../fixtures/api_mocks/teachers-mocks"; const NEW_COURSE: Required = { ...courseMock1, diff --git a/cypress/e2e/full-mode/manager.docs.cy.tsx b/cypress/e2e/full-mode/manager.docs.cy.tsx index 54d326d73..f0a19c6ca 100644 --- a/cypress/e2e/full-mode/manager.docs.cy.tsx +++ b/cypress/e2e/full-mode/manager.docs.cy.tsx @@ -9,7 +9,10 @@ import { workDoc1, workDocsMocks, } from "../../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; describe("Manager.Transcript.Docs", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/manager.fees.cy.tsx b/cypress/e2e/full-mode/manager.fees.cy.tsx index 68e6c3630..e694476a0 100644 --- a/cypress/e2e/full-mode/manager.fees.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.cy.tsx @@ -6,7 +6,10 @@ import { feesTemplatesMocks, } from "../../fixtures/api_mocks/fees-templates-mocks"; import {createPaymentMock} from "../../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; import {assertFeeMatchesTemplate} from "../utils"; /*Added this to make the test blackbox */ diff --git a/cypress/e2e/full-mode/manager.fees.import.cy.tsx b/cypress/e2e/full-mode/manager.fees.import.cy.tsx index b3c63690e..ee81273fb 100644 --- a/cypress/e2e/full-mode/manager.fees.import.cy.tsx +++ b/cypress/e2e/full-mode/manager.fees.import.cy.tsx @@ -1,7 +1,10 @@ import {feesMock} from "../../fixtures/api_mocks/fees-mocks"; import {statsMocks} from "../../fixtures/api_mocks/letters-mocks"; import {manager1Mock} from "../../fixtures/api_mocks/managers-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; type ImportArgs = { file: string; diff --git a/cypress/e2e/full-mode/manager.payments.cy.tsx b/cypress/e2e/full-mode/manager.payments.cy.tsx index b1adc7ffc..be5445934 100644 --- a/cypress/e2e/full-mode/manager.payments.cy.tsx +++ b/cypress/e2e/full-mode/manager.payments.cy.tsx @@ -9,7 +9,10 @@ import { createPaymentWithAmountMock, payment1Mock, } from "../../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; const amount = 1 + Math.floor(Math.random() * 100_000); const createPayment = createPaymentWithAmountMock(amount); diff --git a/cypress/e2e/full-mode/manager.teachers.cy.tsx b/cypress/e2e/full-mode/manager.teachers.cy.tsx index 99a71f0b6..6213f5e3a 100644 --- a/cypress/e2e/full-mode/manager.teachers.cy.tsx +++ b/cypress/e2e/full-mode/manager.teachers.cy.tsx @@ -1,4 +1,7 @@ -import {teacher1Mock, teachersMock} from "../../fixtures/api_mocks/teachers-mocks"; +import { + teacher1Mock, + teachersMock, +} from "../../fixtures/api_mocks/teachers-mocks"; import {updatedInfo} from "../utils"; describe("Manager.Teachers", () => { diff --git a/cypress/e2e/full-mode/monitor.cy.tsx b/cypress/e2e/full-mode/monitor.cy.tsx index 70902e453..07e960642 100644 --- a/cypress/e2e/full-mode/monitor.cy.tsx +++ b/cypress/e2e/full-mode/monitor.cy.tsx @@ -1,5 +1,8 @@ import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; describe("Monitors", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/receipt.cy.tsx b/cypress/e2e/full-mode/receipt.cy.tsx index 2cb11e4f3..d2fe1a2ef 100644 --- a/cypress/e2e/full-mode/receipt.cy.tsx +++ b/cypress/e2e/full-mode/receipt.cy.tsx @@ -3,7 +3,10 @@ import { createPaymentMock, payment1Mock, } from "../../fixtures/api_mocks/payments-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; describe("Student receipt", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/student.docs.cy.tsx b/cypress/e2e/full-mode/student.docs.cy.tsx index 5a51d9de6..cdaca2f8b 100644 --- a/cypress/e2e/full-mode/student.docs.cy.tsx +++ b/cypress/e2e/full-mode/student.docs.cy.tsx @@ -6,7 +6,10 @@ import { workDoc1, workDocsMocks, } from "../../fixtures/api_mocks/docs-mocks"; -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; describe("Transcript.Docs", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/teacher.cy.tsx b/cypress/e2e/full-mode/teacher.cy.tsx index c8b00ce5e..4694e8265 100644 --- a/cypress/e2e/full-mode/teacher.cy.tsx +++ b/cypress/e2e/full-mode/teacher.cy.tsx @@ -1,4 +1,7 @@ -import {student1Mock, studentsMock} from "../../fixtures/api_mocks/students-mocks"; +import { + student1Mock, + studentsMock, +} from "../../fixtures/api_mocks/students-mocks"; import {teacher1Mock} from "../../fixtures/api_mocks/teachers-mocks"; describe("Teacher", () => { From 6505096ee9d6b38ab276d71132572fe86fd2ea35 Mon Sep 17 00:00:00 2001 From: Tokiniaina RAKOTOZANANY Date: Wed, 29 Jul 2026 09:08:15 +0300 Subject: [PATCH 3/5] fix some error in file move --- .github/workflows/ci.yml | 4 ++-- cypress/e2e/full-mode/grade-overview.cy.ts | 2 +- cypress/e2e/full-mode/student.fees.letter.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e74ef65b8..1da867e5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: with: start: npm run dev wait-on: "http://localhost:5173" - command: npx cypress run --env coverage=true --spec "cypress/e2e/{full-mode,shared}/**/*.cy.js" + command: npx cypress run --env coverage=true --spec "cypress/e2e/{full-mode,shared}/**/*.cy.{js,jsx,ts,tsx}" env: REACT_APP_FEES_ONLY: "false" @@ -130,7 +130,7 @@ jobs: with: start: npm run dev wait-on: "http://localhost:5173" - command: npx cypress run --env coverage=true --spec "cypress/e2e/fees-only/**/*.cy.js" + command: npx cypress run --env coverage=true --spec "cypress/e2e/fees-only/**/*.cy.{js,jsx,ts,tsx}" env: REACT_APP_FEES_ONLY: "true" diff --git a/cypress/e2e/full-mode/grade-overview.cy.ts b/cypress/e2e/full-mode/grade-overview.cy.ts index db4d2fda9..8683b1445 100644 --- a/cypress/e2e/full-mode/grade-overview.cy.ts +++ b/cypress/e2e/full-mode/grade-overview.cy.ts @@ -1,4 +1,5 @@ import {WhoamiRoleEnum} from "@haapi-b0fc7615/typescript-client"; +import {getCourseStatusLabel} from "../../../src/operations/grades/utils/constants"; import { courseResultsMock, yearlyResultL2Mock, @@ -8,7 +9,6 @@ import { import {monitor1Mock} from "../../fixtures/api_mocks/monitors-mock"; import {studentLinkedToMonitorMock} from "../../fixtures/api_mocks/students-mocks"; import {summaryResultMocks} from "../../fixtures/api_mocks/summary-result-mocks"; -import {getCourseStatusLabel} from "../../src/operations/grades/utils/constants"; describe("All View", () => { beforeEach(() => { diff --git a/cypress/e2e/full-mode/student.fees.letter.tsx b/cypress/e2e/full-mode/student.fees.letter.tsx index b1d963900..83816411e 100644 --- a/cypress/e2e/full-mode/student.fees.letter.tsx +++ b/cypress/e2e/full-mode/student.fees.letter.tsx @@ -2,8 +2,8 @@ import { acceptedPaymentSlip, feesMock, rejectedPaymentSlip, -} from "../fixtures/api_mocks/fees-mocks"; -import {student1Mock} from "../fixtures/api_mocks/students-mocks"; +} from "../../fixtures/api_mocks/fees-mocks"; +import {student1Mock} from "../../fixtures/api_mocks/students-mocks"; describe.skip("Mobile payment by student", () => { beforeEach(() => { From 6705408ee46c7e364344524ecbd2a270ef48048d Mon Sep 17 00:00:00 2001 From: Tokiniaina RAKOTOZANANY Date: Wed, 29 Jul 2026 10:12:03 +0300 Subject: [PATCH 4/5] fix: add fees only test and workflow to run it --- .github/workflows/fees_only_test.yml | 69 +++++++++++++++++++++++++++ cypress/e2e/fees-only/fees-only.cy.js | 52 ++++++++++---------- 2 files changed, 95 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/fees_only_test.yml diff --git a/.github/workflows/fees_only_test.yml b/.github/workflows/fees_only_test.yml new file mode 100644 index 000000000..e511355ce --- /dev/null +++ b/.github/workflows/fees_only_test.yml @@ -0,0 +1,69 @@ +name: Test fees-only (temp) + +on: + push: + branches: + - "*" + workflow_dispatch: + +env: + REACT_APP_TEST_STUDENT1_PASSWORD: ${{ secrets.STUDENT1_PASSWORD }} + REACT_APP_TEST_TEACHER1_PASSWORD: ${{ secrets.TEACHER1_PASSWORD }} + REACT_APP_TEST_MANAGER1_PASSWORD: ${{ secrets.MANAGER1_PASSWORD }} + REACT_APP_TEST_MONITOR1_PASSWORD: ${{ secrets.MONITOR1_PASSWORD }} + REACT_APP_API_URL: ${{secrets.REACT_APP_API_URL}} + REACT_APP_AWS_REGION: eu-west-3 + REACT_APP_USERPOOL_ID: ${{ vars.PREPROD_USERPOOL_ID }} + REACT_APP_WEBCLIENT_ID: ${{ vars.PREPROD_WEBCLIENT_ID }} + REACT_APP_OAUTH_DOMAIN: ${{ vars.PREPROD_OAUTH_DOMAIN }} + WAF_JS_API_URL: ${{secrets.WAF_JS_API_URL}} + WAF_INTEGRATION_API_KEY: ${{secrets.WAF_INTEGRATION_API_KEY}} + REACT_APP_CASDOOR_SDK_SERVER_URL: ${{ secrets.REACT_APP_CASDOOR_SDK_SERVER_URL }} + REACT_APP_CASDOOR_SDK_CLIENT_ID: ${{ secrets.REACT_APP_CASDOOR_SDK_CLIENT_ID }} + REACT_APP_CASDOOR_SDK_APP_NAME: ${{ secrets.REACT_APP_CASDOOR_SDK_APP_NAME }} + REACT_APP_CASDOOR_SDK_ORGANIZATION_NAME: ${{ secrets.REACT_APP_CASDOOR_SDK_ORGANIZATION_NAME }} + REACT_APP_CASDOOR_SDK_REDIRECT_PATH: ${{ secrets.REACT_APP_CASDOOR_SDK_REDIRECT_PATH }} + +jobs: + test-fees-only: + timeout-minutes: 15 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 18.19.0 + + ## Connect to Numer Private Codeartifact Repository ## + - name: Configure prod AWS credentials + uses: aws-actions/configure-aws-credentials@v4.0.1 + with: + aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.REACT_APP_AWS_REGION }} + - run: sh ./initNpmrc.sh hei-store npm-hei-school 088312068315 + + ## Connect to Numer Private Codeartifact Repository ## + - name: Configure preprod AWS credentials + uses: aws-actions/configure-aws-credentials@v4.0.1 + with: + aws-access-key-id: ${{ secrets.PREPROD_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.PREPROD_AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ env.REACT_APP_AWS_REGION }} + unset-current-credentials: true + - run: sh ./initNpmrc.sh hei-store npm-hei-lab 057045785189 + + - name: Install npm dependencies + run: npm ci + + - name: Run fees-only e2e tests + uses: cypress-io/github-action@v6 + with: + start: npm run dev + wait-on: "http://localhost:5173" + command: npx cypress run --spec "cypress/e2e/fees-only/**/*.cy.{js,jsx,ts,tsx}" + env: + REACT_APP_FEES_ONLY: "true" diff --git a/cypress/e2e/fees-only/fees-only.cy.js b/cypress/e2e/fees-only/fees-only.cy.js index e8f8db91d..1502d693d 100644 --- a/cypress/e2e/fees-only/fees-only.cy.js +++ b/cypress/e2e/fees-only/fees-only.cy.js @@ -1,38 +1,38 @@ -describe("Fees-only mode (REACT_APP_FEES_ONLY=true)", () => { +describe("Fees-only mode - Manager", () => { beforeEach(() => { - cy.login("test.user@mail.com"); - cy.visit("/"); + cy.mockLogin({role: "MANAGER"}); + cy.visit("/profile"); }); - it("hides restricted navigation items", () => { - cy.get('[data-testid="sidebar"]').should("not.exist"); + it("shows only fees-related items in the menu", () => { + cy.get("#ha-menu") + .should("contain", "Étudiants") + .and("contain", "Transactions") + .and("contain", "Frais") + .and("not.contain", "Enseignants"); }); - it("allows access to the fees page", () => { - cy.intercept("GET", "**/fees*", { - statusCode: 200, - body: [], - }).as("getFees"); - cy.visit("/fees"); - cy.wait("@getFees").its("response.statusCode").should("eq", 200); - cy.get('[data-testid="fees-table"]').should("be.visible"); + it("can access the fees page", () => { + cy.get('[href="/fees"]').click(); + cy.url().should("include", "/fees"); }); - it("blocks access to restricted features", () => { - cy.intercept("GET", "**/teachers*", { - statusCode: 400, - body: { - error: "Bad Request: feature disabled in fees-only mode", - }, - }).as("getTeachers"); + it("does not render restricted routes, even via direct URL", () => { cy.visit("/teachers"); - cy.wait("@getTeachers").its("response.statusCode").should("eq", 400); - cy.get('[data-testid="error-message"]').should("be.visible"); - cy.get('[data-testid="teachers-table"]').should("not.exist"); + cy.get('[data-testid="teachers-list"]').should("not.exist"); }); +}); - it("prevents direct navigation to restricted routes", () => { - cy.visit("/teachers"); - cy.url().should("not.include", "/teachers"); +describe("Fees-only mode - Student", () => { + beforeEach(() => { + cy.mockLogin({role: "STUDENT"}); + cy.visit("/profile"); + }); + + it("shows only the fees link in the menu", () => { + cy.get("#ha-menu") + .should("contain", "Frais") + .and("not.contain", "Enseignants") + .and("not.contain", "Étudiants"); }); }); From 30faa1d3d890a19c3b288ff9814426de2c8eb162 Mon Sep 17 00:00:00 2001 From: Tokiniaina RAKOTOZANANY Date: Wed, 29 Jul 2026 12:44:45 +0300 Subject: [PATCH 5/5] Update Cypress e2e test configuration for fees-only mode --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1da867e5a..289592d80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,12 +125,12 @@ jobs: REACT_APP_FEES_ONLY: "false" ## Run Cypress e2e tests (fees-only mode) ## - - name: Run e2e tests (fees-only mode) + - name: Run fees-only e2e tests uses: cypress-io/github-action@v6 with: - start: npm run dev - wait-on: "http://localhost:5173" - command: npx cypress run --env coverage=true --spec "cypress/e2e/fees-only/**/*.cy.{js,jsx,ts,tsx}" + start: npm run dev -- --port 5180 + wait-on: "http://localhost:5180" + command: npx cypress run --env coverage=true --spec "cypress/e2e/fees-only/**/*.cy.{js,jsx,ts,tsx}" --config baseUrl=http://localhost:5180 env: REACT_APP_FEES_ONLY: "true"