Skip to content

Commit

Permalink
chore: add test for added deleteFilesOfParent
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeppner-dataport committed Nov 22, 2023
1 parent 31fe72a commit 6efecc5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { createMock, DeepMocked } from '@golevelup/ts-jest';
import { FileRecordParentType } from '@infra/rabbitmq';
import { EntityManager } from '@mikro-orm/mongodb';
import { FileDto, FilesStorageClientAdapterService } from '@modules/files-storage-client';
import { ContextExternalToolService } from '@modules/tool/context-external-tool/service';
import { Test, TestingModule } from '@nestjs/testing';
import { FileRecordParentType } from '@infra/rabbitmq';
import {
columnBoardFactory,
columnFactory,
Expand Down Expand Up @@ -171,6 +171,14 @@ describe(RecursiveDeleteVisitor.name, () => {
expect(em.remove).toHaveBeenCalledWith(em.getReference(linkElement.constructor, linkElement.id));
expect(em.remove).toHaveBeenCalledWith(em.getReference(childLinkElement.constructor, childLinkElement.id));
});

it('should call deleteFilesOfParent', async () => {
const { linkElement } = setup();

await service.visitLinkElementAsync(linkElement);

expect(filesStorageClientAdapterService.deleteFilesOfParent).toHaveBeenCalledWith(linkElement.id);
});
});

describe('visitSubmissionContainerElementAsync', () => {
Expand Down

0 comments on commit 6efecc5

Please sign in to comment.