From da3857334eb72c022582dc41353c0149848e123d Mon Sep 17 00:00:00 2001 From: Phillip Wirth Date: Mon, 18 Dec 2023 16:44:37 +0100 Subject: [PATCH] BC-6072 fixup h5p unit tests --- .../service/h5p-library-management.service.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/server/src/modules/h5p-library-management/service/h5p-library-management.service.spec.ts b/apps/server/src/modules/h5p-library-management/service/h5p-library-management.service.spec.ts index 9d247682c3c..2a2326781f0 100644 --- a/apps/server/src/modules/h5p-library-management/service/h5p-library-management.service.spec.ts +++ b/apps/server/src/modules/h5p-library-management/service/h5p-library-management.service.spec.ts @@ -53,6 +53,10 @@ describe('H5PLibraryManagementService', () => { await module.close(); }); + afterEach(() => { + jest.resetAllMocks(); + }); + describe('uninstallUnwantedLibraries is called', () => { describe('when wantedLibraries have no dependands', () => { const setup = () => { @@ -195,6 +199,7 @@ describe('H5PLibraryManagementService', () => { const { service } = setup(); const wantedLibraries = ['a', 'b', 'c']; const installContentTypeSpy = jest.spyOn(service.contentTypeRepo, 'installContentType').mockResolvedValue([]); + jest.spyOn(service.contentTypeCache, 'get').mockResolvedValue([]); await service.installLibraries(wantedLibraries); for (const libName of wantedLibraries) { expect(installContentTypeSpy).toHaveBeenCalledWith(libName, expect.anything());