Skip to content

Commit 18e9ba5

Browse files
authored
Revert "EAR 2291 update content for calculated summary question" (#211)
1 parent da37016 commit 18e9ba5

File tree

2 files changed

+5
-51
lines changed

2 files changed

+5
-51
lines changed

src/eq_schema/schema/Block/index.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ class Block {
119119
this.page_title = processPipe(ctx)(page.pageDescription);
120120
}
121121
if (page.pageType === "CalculatedSummaryPage") {
122-
this.title = processPipe(ctx)(page.title).endsWith(".")
123-
? `${processPipe(ctx)(page.title)} Is this correct?`
124-
: `${processPipe(ctx)(page.title)}. Is this correct?`;
125-
122+
this.title = processPipe(ctx)(page.title);
126123
this.page_title =
127124
processPipe(ctx)(page.pageDescription) || processPipe(ctx)(page.title);
128125

src/eq_schema/schema/Block/index.test.js

+4-47
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ describe("Block", () => {
200200
title: "Bye",
201201
},
202202
id: "1",
203-
title: "Hi is your total %(total)s. Is this correct?",
203+
title: "Hi is your total %(total)s",
204204
type: "CalculatedSummary",
205205
});
206206
});
@@ -728,7 +728,7 @@ describe("Block", () => {
728728
id: "summary-page1",
729729
type: "CalculatedSummary",
730730
page_title: "Summary page1",
731-
title: "Summary1. Is this correct?",
731+
title: "Summary1",
732732
calculation: {
733733
operation: {
734734
"+": [
@@ -754,49 +754,6 @@ describe("Block", () => {
754754
});
755755
});
756756

757-
it("Should not add a full stop after the title if it has been added by the user", () => {
758-
const calculatedPageGraphql = {
759-
totalTitle: "<p>Summary title1</p>",
760-
answers: [
761-
{
762-
label: "<p>Summary title1</p>",
763-
type: "Number",
764-
id: "9d2b3354-9751-4be4-9523-1f36345c3069",
765-
validation: {},
766-
properties: {},
767-
},
768-
],
769-
title: "<p>Summary1.</p>",
770-
type: "Number",
771-
pageType: "CalculatedSummaryPage",
772-
summaryAnswers: ["num-1"],
773-
pageDescription: "Summary page1",
774-
alias: null,
775-
id: "summary-page1",
776-
listId: undefined,
777-
};
778-
779-
const block = new Block(calculatedPageGraphql, null, ctx);
780-
781-
expect(block).toMatchObject({
782-
id: "summary-page1",
783-
type: "CalculatedSummary",
784-
page_title: "Summary page1",
785-
title: "Summary1. Is this correct?",
786-
calculation: {
787-
operation: {
788-
"+": [
789-
{
790-
identifier: "answernum-1",
791-
source: "answers",
792-
},
793-
],
794-
},
795-
title: "Summary title1",
796-
},
797-
});
798-
});
799-
800757
it("should build a calculated summary page without skip condition when it contains a normal answer", () => {
801758
const calculatedPageGraphql = {
802759
totalTitle: "<p>Summary title1</p>",
@@ -825,7 +782,7 @@ describe("Block", () => {
825782
id: "summary-page1",
826783
type: "CalculatedSummary",
827784
page_title: "Summary page1",
828-
title: "Summary1. Is this correct?",
785+
title: "Summary1",
829786
calculation: {
830787
operation: {
831788
"+": [
@@ -872,7 +829,7 @@ describe("Block", () => {
872829
id: "grand-summary-1",
873830
type: "GrandCalculatedSummary",
874831
page_title: "Grand summary",
875-
title: "Grand summary. Is this correct?",
832+
title: "Grand summary",
876833
calculation: {
877834
operation: {
878835
"+": [

0 commit comments

Comments
 (0)