Skip to content

Commit

Permalink
Revert "Ear 1808 santise radio values" (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeepkunhis authored Sep 26, 2022
1 parent c380d26 commit c22869d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
4 changes: 1 addition & 3 deletions src/eq_schema/schema/Answer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,9 @@ class Answer {
{ properties, type },
ctx
) {
const newLabel = label.replace(/[^a-zA-Z0-9 ]/g, "");

const option = {
label: buildContents(label, ctx),
value: newLabel,
value: buildContents(label, ctx, true),
};

if (q_code) {
Expand Down
44 changes: 22 additions & 22 deletions src/eq_schema/schema/Group/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ describe("Group", () => {
],
});

const runnerJson = groupsJson.map((group) => new Group(group, ctx));
const runnerJson = groupsJson.map(
(group) => new Group(group, ctx)
);

const expectedrunnerJson = [
{ id: "group1", blocks: [] },
Expand Down Expand Up @@ -127,7 +129,9 @@ describe("Group", () => {
],
});

const runnerJson = groupsJson.map((group) => new Group(group, ctx));
const runnerJson = groupsJson.map(
(group) => new Group(group, ctx)
);

const expectedrunnerJson = [
{ id: "group1", blocks: [] },
Expand Down Expand Up @@ -239,12 +243,12 @@ describe("Group", () => {
options: [
{
label: "Oh yes.",
value: "Oh yes",
value: "Oh yes.",
description: "Positive",
},
{
label: "Wait I can get more?",
value: "Wait I can get more",
value: "Wait I can get more?",
description: "Negative",
},
],
Expand Down Expand Up @@ -298,12 +302,12 @@ describe("Group", () => {
options: [
{
label: "Oh yes.",
value: "Oh yes",
value: "Oh yes.",
description: "Positive",
},
{
label: "Wait I can get more?",
value: "Wait I can get more",
value: "Wait I can get more?",
description: "Negative",
},
],
Expand Down Expand Up @@ -445,23 +449,19 @@ describe("Group", () => {
expect(resultantJson.blocks[1].question.description).toEqual([
{
text: "{checkbox_answers}",
placeholders: [
{
placeholder: "checkbox_answers",
transforms: [
{
arguments: {
list_to_format: {
identifier: "answer6",
source: "answers",
},
},
transform: "format_list",
placeholders: [{
placeholder: "checkbox_answers",
transforms: [{
arguments: {
list_to_format: {
identifier: "answer6",
source: "answers",
},
],
},
],
},
},
transform: "format_list",
}],
}]
}
]);
});
});
Expand Down

0 comments on commit c22869d

Please sign in to comment.