Skip to content

Commit

Permalink
Refactor unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kris-szlapa committed May 28, 2024
1 parent 72c1208 commit 89009fa
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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}]}}

Expand Down

0 comments on commit 89009fa

Please sign in to comment.