Skip to content

Commit d65c5a8

Browse files
committed
fix test and lint issue
1 parent 18736bd commit d65c5a8

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

scripts/utilities/letter-test-data/src/__test__/helpers/create-letter-helpers.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ describe("Create letter helpers", () => {
3333
const status = "PENDING" as LetterStatusType;
3434
const testLetter = "test-letter-standard";
3535

36+
(uploadFile as jest.Mock).mockResolvedValue({ hash: "abc123" });
37+
3638
await createLetter({
3739
letterId,
3840
bucketName,
@@ -65,6 +67,7 @@ describe("Create letter helpers", () => {
6567
subject: "supplier-api/letter-test-data/letterId",
6668
billingRef: "specificationId",
6769
specificationBillingId: "billingId",
70+
sha256Hash: "abc123",
6871
});
6972
});
7073

@@ -116,6 +119,7 @@ describe("Create letter helpers", () => {
116119
source: "/data-plane/letter-rendering/letter-test-data",
117120
subject: "supplier-api/letter-test-data/letterId",
118121
specificationBillingId: "billingId",
122+
sha256Hash: undefined,
119123
});
120124
});
121125

@@ -131,7 +135,6 @@ describe("Create letter helpers", () => {
131135
groupId: "testGroupId",
132136
status: "PENDING" as LetterStatusType,
133137
url: "s3://bucket/testSupplierId/testLetter.pdf",
134-
sha256Hash: "testHash",
135138
};
136139

137140
const result = createLetterDto(params);
@@ -149,7 +152,6 @@ describe("Create letter helpers", () => {
149152
subject: "supplier-api/letter-test-data/testLetterId",
150153
billingRef: "testSpecId",
151154
specificationBillingId: "testBillingId",
152-
sha256Hash: "testHash",
153155
});
154156
});
155157
});

scripts/utilities/letter-test-data/src/helpers/create-letter-helpers.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ export function createLetterDto(params: {
6969
groupId: string;
7070
status: LetterStatusType;
7171
url: string;
72-
sha256Hash?: string;
7372
}) {
7473
const {
7574
billingId,
@@ -79,7 +78,6 @@ export function createLetterDto(params: {
7978
status,
8079
supplierId,
8180
url,
82-
sha256Hash,
8381
} = params;
8482

8583
const letter: Omit<Letter, "ttl" | "supplierStatus" | "supplierStatusSk"> = {
@@ -95,7 +93,6 @@ export function createLetterDto(params: {
9593
subject: `supplier-api/letter-test-data/${letterId}`,
9694
billingRef: specificationId,
9795
specificationBillingId: billingId,
98-
sha256Hash,
9996
};
10097

10198
return letter;

scripts/utilities/letter-test-data/src/helpers/s3-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function uploadFile(
2727

2828
const command = new PutObjectCommand(uploadParams);
2929
const commandResult = await s3.send(command);
30-
return {commandResult, hash};
30+
return { commandResult, hash};
3131
} catch (error) {
3232
console.error("Error uploading file:", error);
3333
throw error;

0 commit comments

Comments
 (0)