added more expects for get() test

This commit is contained in:
Bruno Roesner 2024-12-04 10:00:18 -05:00
parent 0b4bd8a04a
commit 8929ddb5d7

View file

@ -102,6 +102,9 @@ describe('Rooms', () => {
const result = await roomRepo.get(roomID);
expect(db.connect).toHaveBeenCalled();
expect(db.getConnection).toHaveBeenCalled();
expect(collection.findOne).toHaveBeenCalled();
expect(result.id).toBe("123456");
});
@ -111,6 +114,9 @@ describe('Rooms', () => {
const result = await roomRepo.get(roomID);
expect(db.connect).toHaveBeenCalled();
expect(db.getConnection).toHaveBeenCalled();
expect(collection.findOne).toHaveBeenCalled();
expect(result).toBeNull();
});
@ -126,6 +132,7 @@ describe('Rooms', () => {
const result = await roomRepo.getAll();
expect(db.connect).toHaveBeenCalled();
expect(collection.find).toHaveBeenCalled();
expect(result).toEqual(rooms);
});