From 3416a21319dcaf35bc8a9a2614188098e0ff039b Mon Sep 17 00:00:00 2001 From: bsilkyn Date: Tue, 7 May 2024 18:27:23 +0200 Subject: [PATCH] test: test update #400 --- frontend/cypress.config.js | 2 +- frontend/src/composables/services/student.service.ts | 2 +- frontend/src/test/unit/services/setup/data.ts | 8 ++++---- frontend/src/test/unit/services/setup/post_handlers.ts | 2 +- frontend/src/test/unit/services/student_service.test.ts | 4 ++-- frontend/src/test/unit/types/helper.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/cypress.config.js b/frontend/cypress.config.js index 5975fc9d..6b759d73 100644 --- a/frontend/cypress.config.js +++ b/frontend/cypress.config.js @@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'; export default defineConfig({ e2e: { - baseUrl: 'https://localhost', + baseUrl: 'http://nginx', specPattern: 'src/test/e2e/**/*.cy.{js,jsx,ts,tsx}', }, }); diff --git a/frontend/src/composables/services/student.service.ts b/frontend/src/composables/services/student.service.ts index 8c1e62b2..c70c67bd 100644 --- a/frontend/src/composables/services/student.service.ts +++ b/frontend/src/composables/services/student.service.ts @@ -73,7 +73,7 @@ export function useStudents(): StudentsState { endpoint, { user: studentData.id, - student_id: studentData.studentId, + student_id: studentData.student_id, }, student, Student.fromJSON, diff --git a/frontend/src/test/unit/services/setup/data.ts b/frontend/src/test/unit/services/setup/data.ts index 1ad12327..f25084c9 100644 --- a/frontend/src/test/unit/services/setup/data.ts +++ b/frontend/src/test/unit/services/setup/data.ts @@ -158,7 +158,7 @@ export const students = [ last_name: 'Doe', last_enrolled: 2023, create_time: new Date('July 21, 2024 01:15:00'), - studentId: null, + student_id: null, roles: ['student'], courses: ['1', '2', '3'], groups: ['0'], @@ -174,7 +174,7 @@ export const students = [ last_name: 'Verhaege', last_enrolled: 2023, create_time: new Date('July 21, 2024 01:15:00'), - studentId: null, + student_id: null, roles: ['student'], courses: [], groups: [], @@ -190,7 +190,7 @@ export const students = [ last_name: 'Verslype', last_enrolled: 2023, create_time: new Date('July 21, 2024 01:15:00'), - studentId: '02012470', + student_id: '02012470', roles: ['student'], courses: [], groups: [], @@ -206,7 +206,7 @@ export const students = [ last_name: 'somtin', last_enrolled: 2023, create_time: new Date('July 21, 2024 01:15:00'), - studentId: null, + student_id: null, roles: ['student'], courses: [], groups: [], diff --git a/frontend/src/test/unit/services/setup/post_handlers.ts b/frontend/src/test/unit/services/setup/post_handlers.ts index 6ae01af8..5409c5df 100644 --- a/frontend/src/test/unit/services/setup/post_handlers.ts +++ b/frontend/src/test/unit/services/setup/post_handlers.ts @@ -37,7 +37,7 @@ export const postHandlers = [ const buffer = await request.arrayBuffer(); const requestBody = new TextDecoder().decode(buffer); const newStudent = JSON.parse(requestBody); - students.push({ id: newStudent.user, studentId: newStudent.student_id, ...newStudent }); + students.push({ id: newStudent.user, student_id: newStudent.student_id, ...newStudent }); return HttpResponse.json(students); }), http.post(baseUrl + endpoints.courses.index, async ({ request }) => { diff --git a/frontend/src/test/unit/services/student_service.test.ts b/frontend/src/test/unit/services/student_service.test.ts index 5b9fc047..6b8ddc12 100644 --- a/frontend/src/test/unit/services/student_service.test.ts +++ b/frontend/src/test/unit/services/student_service.test.ts @@ -181,7 +181,7 @@ describe('students', (): void => { 2024, // last_enrolled new Date(), // create_time null, // last_login - 'studentId', // studentId + 'student_id', // student_id [], [], [], @@ -202,6 +202,6 @@ describe('students', (): void => { // Only check for fields that are sent to the backend expect(students.value?.[prevLength]?.id).toBe('id'); - expect(students.value?.[prevLength]?.student_id).toBe('studentId'); + expect(students.value?.[prevLength]?.student_id).toBe('student_id'); }); }); diff --git a/frontend/src/test/unit/types/helper.ts b/frontend/src/test/unit/types/helper.ts index 97604c47..60c32d6b 100644 --- a/frontend/src/test/unit/types/helper.ts +++ b/frontend/src/test/unit/types/helper.ts @@ -25,7 +25,7 @@ export function createStudent(studentData: any): Student { studentData.last_enrolled, studentData.create_time, studentData.last_login, - studentData.studentId, + studentData.student_id, studentData.roles.slice(), studentData.courses.slice(), studentData.groups.slice(),