From adb77c97e434ace4843e8bee1838bd893915fa9d Mon Sep 17 00:00:00 2001 From: WojciechGrancow Date: Wed, 15 Nov 2023 09:30:59 +0100 Subject: [PATCH] add test for deletionRequestResponse --- ...=> deletion-executions.controller.spec.ts} | 0 .../dto/deletion-request.response.spec.ts | 26 +++++++++++++++++++ 2 files changed, 26 insertions(+) rename apps/server/src/modules/deletion/controller/{deletion-executon.controller.spec.ts => deletion-executions.controller.spec.ts} (100%) create mode 100644 apps/server/src/modules/deletion/controller/dto/deletion-request.response.spec.ts diff --git a/apps/server/src/modules/deletion/controller/deletion-executon.controller.spec.ts b/apps/server/src/modules/deletion/controller/deletion-executions.controller.spec.ts similarity index 100% rename from apps/server/src/modules/deletion/controller/deletion-executon.controller.spec.ts rename to apps/server/src/modules/deletion/controller/deletion-executions.controller.spec.ts diff --git a/apps/server/src/modules/deletion/controller/dto/deletion-request.response.spec.ts b/apps/server/src/modules/deletion/controller/dto/deletion-request.response.spec.ts new file mode 100644 index 00000000000..4356579cbdc --- /dev/null +++ b/apps/server/src/modules/deletion/controller/dto/deletion-request.response.spec.ts @@ -0,0 +1,26 @@ +import { deletionRequestFactory } from '../../domain/testing/factory/deletion-request.factory'; +import { DeletionRequestResponse } from './deletion-request.response'; + +describe(DeletionRequestResponse.name, () => { + describe('constructor', () => { + describe('when passed properties', () => { + const setup = () => { + const deletionRequest = deletionRequestFactory.build(); + const deletionRequestResponse: DeletionRequestResponse = { + requestId: deletionRequest.id, + deletionPlannedAt: deletionRequest.deleteAfter, + }; + + return { deletionRequestResponse }; + }; + + it('should set the id', () => { + const { deletionRequestResponse } = setup(); + + const deletionRequest = new DeletionRequestResponse(deletionRequestResponse); + + expect(deletionRequest.requestId).toEqual(deletionRequestResponse.requestId); + }); + }); + }); +});