@@ -200,7 +200,7 @@ describe("Block", () => {
200
200
title : "Bye" ,
201
201
} ,
202
202
id : "1" ,
203
- title : "Hi is your total %(total)s" ,
203
+ title : "Hi is your total %(total)s. Is this correct? " ,
204
204
type : "CalculatedSummary" ,
205
205
} ) ;
206
206
} ) ;
@@ -728,7 +728,7 @@ describe("Block", () => {
728
728
id : "summary-page1" ,
729
729
type : "CalculatedSummary" ,
730
730
page_title : "Summary page1" ,
731
- title : "Summary1" ,
731
+ title : "Summary1. Is this correct? " ,
732
732
calculation : {
733
733
operation : {
734
734
"+" : [
@@ -754,6 +754,49 @@ describe("Block", () => {
754
754
} ) ;
755
755
} ) ;
756
756
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
+
757
800
it ( "should build a calculated summary page without skip condition when it contains a normal answer" , ( ) => {
758
801
const calculatedPageGraphql = {
759
802
totalTitle : "<p>Summary title1</p>" ,
@@ -782,7 +825,7 @@ describe("Block", () => {
782
825
id : "summary-page1" ,
783
826
type : "CalculatedSummary" ,
784
827
page_title : "Summary page1" ,
785
- title : "Summary1" ,
828
+ title : "Summary1. Is this correct? " ,
786
829
calculation : {
787
830
operation : {
788
831
"+" : [
@@ -829,7 +872,7 @@ describe("Block", () => {
829
872
id : "grand-summary-1" ,
830
873
type : "GrandCalculatedSummary" ,
831
874
page_title : "Grand summary" ,
832
- title : "Grand summary" ,
875
+ title : "Grand summary. Is this correct? " ,
833
876
calculation : {
834
877
operation : {
835
878
"+" : [
0 commit comments