fix(backend): Testen LearningPathRepository gerepareerd na refactoring.
This commit is contained in:
parent
a3be3699f2
commit
ee9afab6ca
2 changed files with 34 additions and 24 deletions
|
@ -141,3 +141,20 @@ export function expectToBeCorrectLearningPath(
|
|||
expect(new Set(node.transitions.map((it) => it.next.version))).toEqual(new Set(expectedNode.transitions.map((it) => it.next.version)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Expect that the given result is a singleton list with exactly the given element.
|
||||
*/
|
||||
export function expectToHaveFoundPrecisely<T extends object>(expected: T, result: T[]): void {
|
||||
expect(result).toHaveProperty('length');
|
||||
expect(result.length).toBe(1);
|
||||
expectToBeCorrectEntity(result[0], expected);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expect that the given result is an empty list.
|
||||
*/
|
||||
export function expectToHaveFoundNothing<T>(result: T[]): void {
|
||||
expect(result).toHaveProperty('length');
|
||||
expect(result.length).toBe(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue