feat: qol functies toegevoegd, tests voor submissions aan het schrijven
This commit is contained in:
parent
ef8bc71018
commit
c9739a1420
2 changed files with 84 additions and 0 deletions
12
backend/tests/controllers/qol.ts
Normal file
12
backend/tests/controllers/qol.ts
Normal 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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue