Skip to content

Commit

Permalink
BC-6072 - fix h5p unit tests (#4651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki-Afro authored Dec 18, 2023
1 parent 291e2da commit e1c1edd
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ describe('H5PLibraryManagementService', () => {
await module.close();
});

afterEach(() => {
jest.resetAllMocks();
});

describe('uninstallUnwantedLibraries is called', () => {
describe('when wantedLibraries have no dependands', () => {
const setup = () => {
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit e1c1edd

Please sign in to comment.