Skip to content

Commit

Permalink
Update presenters to work with latest hmpo-components
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinc committed Oct 18, 2024
1 parent 65a07fd commit 0ac5a7d
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/presenters/answer-to-radio-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@ module.exports = function (answer, translate) {
id: answer,
value: answer,
text: text,
hint: {
html: " ",
},
conditional: {
html: "",
},
};
};
36 changes: 36 additions & 0 deletions src/presenters/answer-to-radio-item.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "answers.noneOfTheAbove",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand All @@ -44,6 +50,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "answers.overUpToAmount",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand All @@ -70,6 +82,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "answers.upToAmount",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand All @@ -92,6 +110,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "answers.upToMonths",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand All @@ -113,6 +137,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "answers.overUpToMonths",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand All @@ -139,6 +169,12 @@ describe("answer-to-radio-item", () => {
id: answer,
value: answer,
text: "AN UNMATCHED STRING",
hint: {
html: " ",
},
conditional: {
html: "",
},
});
});

Expand Down
54 changes: 50 additions & 4 deletions src/presenters/question-to-radios.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,60 @@ describe("question-to-radios", () => {
config = presenters.questionToRadios(question, translate);

expect(config.items).to.deep.equal([
{ id: "01 / 2022", value: "01 / 2022", text: "01 / 2022" },
{ id: "05 / 1999", value: "05 / 1999", text: "05 / 1999" },
{ id: "12 / 2020", value: "12 / 2020", text: "12 / 2020" },
{ id: "07 / 2012", value: "07 / 2012", text: "07 / 2012" },
{
id: "01 / 2022",
value: "01 / 2022",
text: "01 / 2022",
hint: {
html: " ",
},
conditional: {
html: "",
},
},
{
id: "05 / 1999",
value: "05 / 1999",
text: "05 / 1999",
hint: {
html: " ",
},
conditional: {
html: "",
},
},
{
id: "12 / 2020",
value: "12 / 2020",
text: "12 / 2020",
hint: {
html: " ",
},
conditional: {
html: "",
},
},
{
id: "07 / 2012",
value: "07 / 2012",
text: "07 / 2012",
hint: {
html: " ",
},
conditional: {
html: "",
},
},
{
id: "NONE OF THE ABOVE / DOES NOT APPLY",
value: "NONE OF THE ABOVE / DOES NOT APPLY",
text: "NONE OF THE ABOVE / DOES NOT APPLY",
hint: {
html: " ",
},
conditional: {
html: "",
},
},
]);
});
Expand Down

0 comments on commit 0ac5a7d

Please sign in to comment.