Skip to content

Commit

Permalink
test: test update #400
Browse files Browse the repository at this point in the history
  • Loading branch information
bsilkyn committed May 8, 2024
1 parent ad3cc85 commit 3b4a8ce
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion frontend/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
},
});
2 changes: 1 addition & 1 deletion frontend/src/composables/services/student.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function useStudents(): StudentsState {
endpoint,
{
user: studentData.id,
student_id: studentData.studentId,
student_id: studentData.student_id,
},
student,
Student.fromJSON,
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/test/unit/services/setup/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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: [],
Expand All @@ -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: [],
Expand All @@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/test/unit/services/setup/post_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/test/unit/services/student_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('students', (): void => {
2024, // last_enrolled
new Date(), // create_time
null, // last_login
'studentId', // studentId
'student_id', // student_id
[],
[],
[],
Expand All @@ -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');
});
});
2 changes: 1 addition & 1 deletion frontend/src/test/unit/types/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 3b4a8ce

Please sign in to comment.