mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
added more expects for get() test
This commit is contained in:
parent
0b4bd8a04a
commit
8929ddb5d7
1 changed files with 7 additions and 0 deletions
|
|
@ -102,6 +102,9 @@ describe('Rooms', () => {
|
||||||
|
|
||||||
const result = await roomRepo.get(roomID);
|
const result = await roomRepo.get(roomID);
|
||||||
|
|
||||||
|
expect(db.connect).toHaveBeenCalled();
|
||||||
|
expect(db.getConnection).toHaveBeenCalled();
|
||||||
|
expect(collection.findOne).toHaveBeenCalled();
|
||||||
expect(result.id).toBe("123456");
|
expect(result.id).toBe("123456");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -111,6 +114,9 @@ describe('Rooms', () => {
|
||||||
|
|
||||||
const result = await roomRepo.get(roomID);
|
const result = await roomRepo.get(roomID);
|
||||||
|
|
||||||
|
expect(db.connect).toHaveBeenCalled();
|
||||||
|
expect(db.getConnection).toHaveBeenCalled();
|
||||||
|
expect(collection.findOne).toHaveBeenCalled();
|
||||||
expect(result).toBeNull();
|
expect(result).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -126,6 +132,7 @@ describe('Rooms', () => {
|
||||||
const result = await roomRepo.getAll();
|
const result = await roomRepo.getAll();
|
||||||
|
|
||||||
expect(db.connect).toHaveBeenCalled();
|
expect(db.connect).toHaveBeenCalled();
|
||||||
|
expect(collection.find).toHaveBeenCalled();
|
||||||
expect(result).toEqual(rooms);
|
expect(result).toEqual(rooms);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue