Skip to content

Commit cefd277

Browse files
review changes
1 parent e3bdbbf commit cefd277

File tree

3 files changed

+1488
-535
lines changed

3 files changed

+1488
-535
lines changed

lambdas/mi-updates-transformer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"@aws-sdk/client-sns": "^3.940.0",
3+
"@aws-sdk/client-sns": "^3.954.0",
44
"@aws-sdk/util-dynamodb": "^3.943.0",
55
"@internal/datastore": "^0.1.0",
66
"@nhsdigital/nhs-notify-event-schemas-supplier-api": "*",

lambdas/mi-updates-transformer/src/__tests__/mi-updates-transformer.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,19 @@ describe("mi-updates-transformer Lambda", () => {
109109
);
110110
});
111111

112+
it("does not publish invalid MI data", async () => {
113+
const handler = createHandler(mockedDeps);
114+
const miEvent = { id: String(1232) } as MI; // missing required fields
115+
116+
const insertMI = generateInsertRecord(miEvent);
117+
const testData = generateKinesisEvent([insertMI]);
118+
await expect(
119+
handler(testData, mockDeep<Context>(), jest.fn()),
120+
).rejects.toThrow();
121+
122+
expect(mockedDeps.snsClient.send).not.toHaveBeenCalled();
123+
});
124+
112125
it("batches mutiple records into a single call to SNS", async () => {
113126
const handler = createHandler(mockedDeps);
114127
const miEvents = generateMIEvents(10);

0 commit comments

Comments
 (0)