Skip to content

Commit

Permalink
add test for deletionRequestLogResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechGrancow committed Nov 15, 2023
1 parent adb77c9 commit 9a04a4a
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { DeletionDomainModel } from '../../domain/types/deletion-domain-model.enum';
import { DeletionLogStatisticBuilder } from '../../uc/builder/deletion-log-statistic.builder';
import { DeletionTargetRefBuilder } from '../../uc/builder/deletion-target-ref.builder';
import { DeletionRequestLogResponse } from './deletion-request-log.response';

describe(DeletionRequestLogResponse.name, () => {
describe('constructor', () => {
describe('when passed properties', () => {
const setup = () => {
const targetRefDomain = DeletionDomainModel.PSEUDONYMS;
const targetRefId = '653e4833cc39e5907a1e18d2';
const targetRef = DeletionTargetRefBuilder.build(targetRefDomain, targetRefId);
const deletionPlannedAt = new Date();
const modifiedCount = 0;
const deletedCount = 2;
const statistics = [DeletionLogStatisticBuilder.build(targetRefDomain, modifiedCount, deletedCount)];

return { targetRef, deletionPlannedAt, statistics };
};

it('should set the id', () => {
const { targetRef, deletionPlannedAt, statistics } = setup();

const deletionRequestLog = new DeletionRequestLogResponse({ targetRef, deletionPlannedAt, statistics });

expect(deletionRequestLog.targetRef).toEqual(targetRef);
expect(deletionRequestLog.deletionPlannedAt).toEqual(deletionPlannedAt);
expect(deletionRequestLog.statistics).toEqual(statistics);
});
});
});
});

0 comments on commit 9a04a4a

Please sign in to comment.