feat: testen voor submissions geimplementeerd
This commit is contained in:
parent
f0eb4822d9
commit
7a443c0686
3 changed files with 27 additions and 14 deletions
|
@ -1,12 +1,16 @@
|
|||
export function checkReturnList(jsonMock: Mock, listName: string) {
|
||||
export function checkReturnList(jsonMock: Mock, listName: string, length?: number) {
|
||||
expect(jsonMock).toHaveBeenCalled();
|
||||
|
||||
const result = jsonMock.mock.lastCall![0];
|
||||
|
||||
expect(listName in result).toBeTruthy();
|
||||
|
||||
if (length) {
|
||||
expect(result[listName].length).toBe(length);
|
||||
}
|
||||
}
|
||||
|
||||
export function checkReturn404(jsonMock: Mock, statusMock: Mock) {
|
||||
expect(statusMock).toHaveBeenCalledWith(404);
|
||||
expect(jsonMock).toHaveBeenCalled();
|
||||
expect(statusMock).toHaveBeenCalledWith(404);
|
||||
expect(jsonMock).toHaveBeenCalled();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue