test: zet alle data klaar in de setup file en pas reeds gemaakte testen aan om met deze data te werken

This commit is contained in:
Laure Jablonski 2025-03-08 18:34:40 +01:00
parent 595f248f11
commit fcd9f66e28
6 changed files with 498 additions and 102 deletions

View file

@ -12,22 +12,22 @@ describe('ClassRepository', () => {
});
it('should return nothing because id does not exist', async () => {
const classVar = await ClassRepository.findById('id');
const classVar = await ClassRepository.findById('test_id');
expect(classVar).toBeNull();
});
it('should return requested class', async () => {
const classVar = await ClassRepository.findById('class_id01');
const classVar = await ClassRepository.findById('id01');
expect(classVar).toBeTruthy();
expect(classVar?.displayName).toBe('class01');
});
it('class should be gone after deletion', async () => {
await ClassRepository.deleteById('class_id01');
await ClassRepository.deleteById('id04');
const classVar = await ClassRepository.findById('class_id01');
const classVar = await ClassRepository.findById('id04');
expect(classVar).toBeNull();
});