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:
parent
595f248f11
commit
fcd9f66e28
6 changed files with 498 additions and 102 deletions
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue