From 89009faf7153dc2ea64cc416fda81887d1eca522 Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 28 May 2024 11:08:24 +0000 Subject: [PATCH] Refactor unit tests --- .../tests/validation/testRequestContentValidation.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/updatePrescriptionStatus/tests/validation/testRequestContentValidation.test.ts b/packages/updatePrescriptionStatus/tests/validation/testRequestContentValidation.test.ts index 6220143ab..fa011cd7e 100644 --- a/packages/updatePrescriptionStatus/tests/validation/testRequestContentValidation.test.ts +++ b/packages/updatePrescriptionStatus/tests/validation/testRequestContentValidation.test.ts @@ -211,7 +211,7 @@ describe("Unit tests for validation of NHS number", () => { }) describe("Unit tests for validation of status against business status", () => { - it.each([ + const testCases = [ { taskStatus: "completed", businessStatus: "With Pharmacy", @@ -282,8 +282,9 @@ describe("Unit tests for validation of status against business status", () => { businessStatus: "Ready to dispatch - partial", expected: undefined } - ])( - "When status is '$status' and business status is '$businessStatus', should return expected issue.", + ] + it.each(testCases)( + "When status is '$taskStatus' and business status is '$businessStatus', should return expected issue.", async ({taskStatus, businessStatus, expected}) => { const task = {status: taskStatus, businessStatus: {coding: [{code: businessStatus}]}}