Skip to content

Commit

Permalink
BC-6072 fixup h5p unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Loki-Afro committed Dec 18, 2023
1 parent 555c445 commit da38573
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 da38573

Please sign in to comment.