Skip to content

Commit

Permalink
Added last test
Browse files Browse the repository at this point in the history
  • Loading branch information
Peco1503 committed Jun 15, 2024
1 parent a6be3ef commit 4e03078
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/educationService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,35 @@ describe('Education Services', () => {
where: { education_id: mockEducationId },
});
});

test('getEducation should return all education records', async () => {
const expectedEducations = [
{
education_id: '1',
school: 'Tec de Monterrey',
education_degree: 'Computer Science',
gpa: 4.0,
start_date: new Date('2024-04-01'),
end_date: new Date('2027-06-01'),
relevant_coursework: 'Sample Coursework'
},
{
education_id: '2',
school: 'UDEM',
education_degree: 'Arts',
gpa: 3.5,
start_date: new Date('2018-05-12'),
end_date: new Date('2022-05-01'),
relevant_coursework: 'Another Coursework'
}
];

// Perform the function call
const educations = await educationService.getEducation();

// Check that the returned value matches the expected mock value
expect(educations).toEqual(expectedEducations);
// Verify the method was called correctly
expect(prisma.education.findMany).toHaveBeenCalledWith();
});
});

0 comments on commit 4e03078

Please sign in to comment.