From 784ac277d0ca96819a3aaaf13ff6ed55ef174523 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Wed, 26 Feb 2025 13:06:03 -0500 Subject: [PATCH] =?UTF-8?q?corriger=20tests=20bris=C3=A9s=20supprimer=20te?= =?UTF-8?q?sts=20de=20contenu=20de=20salle=20(copier-coller=20des=20tests?= =?UTF-8?q?=20de=20dossier=20je=20crois)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/__tests__/rooms.test.js | 35 ---------------------------------- 1 file changed, 35 deletions(-) diff --git a/server/__tests__/rooms.test.js b/server/__tests__/rooms.test.js index 367adb7..d589e6f 100644 --- a/server/__tests__/rooms.test.js +++ b/server/__tests__/rooms.test.js @@ -119,41 +119,6 @@ describe('Rooms', () => { }); }); - // write a test for getContent - describe('getContent', () => { - it('should return the content of a room', async () => { - const roomId = '60c72b2f9b1d8b3a4c8e4d3b'; - const content = [ - { title: 'salle 1', content: [] }, - { title: 'salle 2', content: [] }, - ]; - - // Mock the database response - collection.find().toArray.mockResolvedValue(content); - - const result = await rooms.getContent(roomId); - - expect(db.connect).toHaveBeenCalled(); - expect(db.collection).toHaveBeenCalledWith('files'); - expect(collection.find).toHaveBeenCalledWith({ roomId }); - expect(result).toEqual(content); - }); - - it('should return an empty array if the room has no content', async () => { - const roomId = '60c72b2f9b1d8b3a4c8e4d3b'; - - // Mock the database response - collection.find().toArray.mockResolvedValue([]); - - const result = await rooms.getContent(roomId); - - expect(db.connect).toHaveBeenCalled(); - expect(db.collection).toHaveBeenCalledWith('files'); - expect(collection.find).toHaveBeenCalledWith({ roomId }); - expect(result).toEqual([]); - }); - }); - describe('delete', () => { it('should delete a room and return true', async () => { const roomId = '60c72b2f9b1d8b3a4c8e4d3b';