feat: qol functies toegevoegd, tests voor submissions aan het schrijven

This commit is contained in:
Adriaan Jacquet 2025-03-29 21:10:04 +01:00
parent ef8bc71018
commit c9739a1420
2 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,12 @@
export function checkReturnList(jsonMock: Mock, listName: string) {
expect(jsonMock).toHaveBeenCalled();
const result = jsonMock.mock.lastCall![0];
expect(listName in result).toBeTruthy();
}
export function checkReturn404(jsonMock: Mock, statusMock: Mock) {
expect(statusMock).toHaveBeenCalledWith(404);
expect(jsonMock).toHaveBeenCalled();
}