Skip to content

Commit

Permalink
Update test qCode values
Browse files Browse the repository at this point in the history
  • Loading branch information
farres1 committed Jan 16, 2025
1 parent 80bf882 commit 0cad14a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions eq-author-api/migrations/removeConfirmationPageQCodes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("removeConfirmationPageQCodes", () => {
id: "page-1",
confirmation: {
id: "confirmation-page-1",
qCode: "123",
qCode: "confirmation-page-1-qcode",
},
},
],
Expand Down Expand Up @@ -45,12 +45,12 @@ describe("removeConfirmationPageQCodes", () => {
answers: [
{
id: "answer-1",
qCode: "123",
qCode: "answer-1-qCode",
},
],
confirmation: {
id: "confirmation-page-1",
qCode: "123",
qCode: "confirmation-page-1-qCode",
},
},
],
Expand All @@ -65,7 +65,9 @@ describe("removeConfirmationPageQCodes", () => {
expect(
result.sections[0].folders[0].pages[0].confirmation.qCode
).toBeUndefined();
expect(result.sections[0].folders[0].pages[0].answers[0].qCode).toBe("123");
expect(result.sections[0].folders[0].pages[0].answers[0].qCode).toBe(
"answer-1-qCode"
);
});

it("should not amend questionnaire data if the questionnaire does not contain any confirmation pages", () => {
Expand All @@ -82,7 +84,7 @@ describe("removeConfirmationPageQCodes", () => {
answers: [
{
id: "answer-1",
qCode: "123",
qCode: "answer-1-qCode",
},
],
},
Expand All @@ -95,7 +97,9 @@ describe("removeConfirmationPageQCodes", () => {

const result = removeConfirmationPageQCodes(questionnaire);

expect(result.sections[0].folders[0].pages[0].answers[0].qCode).toBe("123");
expect(result.sections[0].folders[0].pages[0].answers[0].qCode).toBe(
"answer-1-qCode"
);
expect(result).toEqual(questionnaire);
});

Expand Down

0 comments on commit 0cad14a

Please sign in to comment.