@@ -547,15 +547,15 @@ describe("Content Filter", () => {
547547 overview : { content : "Generic Vaccine Lead Paragraph (overview)" , containsHtml : false } ,
548548 } ;
549549
550- const pageCopyForRsv = getFilteredContentForVaccine (
550+ const pageCopyForRsv = await getFilteredContentForVaccine (
551551 VaccineType . RSV ,
552552 JSON . stringify ( genericVaccineContentAPIResponse ) ,
553553 ) ;
554554
555555 expect ( pageCopyForRsv ) . toEqual ( expect . objectContaining ( expectedOverview ) ) ;
556556 } ) ;
557557
558- it ( "should return all parts for whatVaccineIsFor section" , ( ) => {
558+ it ( "should return all parts for whatVaccineIsFor section" , async ( ) => {
559559 const expectedWhatVaccineIsFor = {
560560 whatVaccineIsFor : {
561561 headline : "Benefits Health Aspect headline" ,
@@ -570,15 +570,15 @@ describe("Content Filter", () => {
570570 } ,
571571 } ;
572572
573- const pageCopyForRsv = getFilteredContentForVaccine (
573+ const pageCopyForRsv = await getFilteredContentForVaccine (
574574 VaccineType . RSV ,
575575 JSON . stringify ( genericVaccineContentAPIResponse ) ,
576576 ) ;
577577
578578 expect ( pageCopyForRsv ) . toEqual ( expect . objectContaining ( expectedWhatVaccineIsFor ) ) ;
579579 } ) ;
580580
581- it ( "should return all parts for whoVaccineIsFor section" , ( ) => {
581+ it ( "should return all parts for whoVaccineIsFor section" , async ( ) => {
582582 const expectedWhoVaccineIsFor = {
583583 whoVaccineIsFor : {
584584 headline : "Suitability Health Aspect headline" ,
@@ -617,15 +617,15 @@ describe("Content Filter", () => {
617617 } ,
618618 } ;
619619
620- const pageCopyForRsv = getFilteredContentForVaccine (
620+ const pageCopyForRsv = await getFilteredContentForVaccine (
621621 VaccineType . RSV ,
622622 JSON . stringify ( genericVaccineContentAPIResponse ) ,
623623 ) ;
624624
625625 expect ( pageCopyForRsv ) . toEqual ( expect . objectContaining ( expectedWhoVaccineIsFor ) ) ;
626626 } ) ;
627627
628- it ( "should return all parts for howToGetVaccine section" , ( ) => {
628+ it ( "should return all parts for howToGetVaccine section" , async ( ) => {
629629 const expectedHowToGetVaccine = {
630630 howToGetVaccine : {
631631 headline : "Getting Access Health Aspect headline" ,
@@ -646,15 +646,15 @@ describe("Content Filter", () => {
646646 } ,
647647 } ;
648648
649- const pageCopyForRsv = getFilteredContentForVaccine (
649+ const pageCopyForRsv = await getFilteredContentForVaccine (
650650 VaccineType . RSV ,
651651 JSON . stringify ( genericVaccineContentAPIResponse ) ,
652652 ) ;
653653
654654 expect ( pageCopyForRsv ) . toEqual ( expect . objectContaining ( expectedHowToGetVaccine ) ) ;
655655 } ) ;
656656
657- it ( "should return all parts for vaccineSideEffects section" , ( ) => {
657+ it ( "should return all parts for vaccineSideEffects section" , async ( ) => {
658658 const expectedVaccineSideEffects : VaccinePageSection = {
659659 headline : "Side effects of the generic vaccine" ,
660660 subsections : [
@@ -679,57 +679,57 @@ describe("Content Filter", () => {
679679 ] ,
680680 } ;
681681
682- const pageCopyForRsv : VaccinePageContent = getFilteredContentForVaccine (
682+ const pageCopyForRsv : VaccinePageContent = await getFilteredContentForVaccine (
683683 VaccineType . RSV ,
684684 JSON . stringify ( genericVaccineContentAPIResponse ) ,
685685 ) ;
686686
687687 expect ( pageCopyForRsv . vaccineSideEffects ) . toEqual ( expectedVaccineSideEffects ) ;
688688 } ) ;
689689
690- it ( "should include nhs webpage link to vaccine info" , ( ) => {
690+ it ( "should include nhs webpage link to vaccine info" , async ( ) => {
691691 const expectedWebpageLink = {
692692 webpageLink : new URL ( "https://www.nhs.uk/vaccinations/generic-vaccine/" ) ,
693693 } ;
694694
695- const pageCopyForRsv = getFilteredContentForVaccine (
695+ const pageCopyForRsv = await getFilteredContentForVaccine (
696696 VaccineType . RSV ,
697697 JSON . stringify ( genericVaccineContentAPIResponse ) ,
698698 ) ;
699699
700700 expect ( pageCopyForRsv ) . toEqual ( expect . objectContaining ( expectedWebpageLink ) ) ;
701701 } ) ;
702702
703- it ( "should not return whatVaccineIsFor section when BenefitsHealthAspect is missing" , ( ) => {
703+ it ( "should not return whatVaccineIsFor section when BenefitsHealthAspect is missing" , async ( ) => {
704704 const responseWithoutBenefitsHealthAspect = contentWithoutBenefitsHealthAspect ( ) ;
705705
706- const pageCopyForFlu : VaccinePageContent = getFilteredContentForVaccine (
706+ const pageCopyForFlu : VaccinePageContent = await getFilteredContentForVaccine (
707707 VaccineType . RSV ,
708708 JSON . stringify ( responseWithoutBenefitsHealthAspect ) ,
709709 ) ;
710710
711711 expect ( pageCopyForFlu . whatVaccineIsFor ) . toBeUndefined ( ) ;
712712 } ) ;
713713
714- it ( "should return all parts for callout section" , ( ) => {
714+ it ( "should return all parts for callout section" , async ( ) => {
715715 const expectedCallout : HeadingWithTypedContent = {
716716 heading : "Callout heading" ,
717717 content : "<p>Callout content</p>" ,
718718 contentType : "html" ,
719719 } ;
720720
721- const pageCopyForRsv : VaccinePageContent = getFilteredContentForVaccine (
721+ const pageCopyForRsv : VaccinePageContent = await getFilteredContentForVaccine (
722722 VaccineType . RSV ,
723723 JSON . stringify ( genericVaccineContentAPIResponse ) ,
724724 ) ;
725725
726726 expect ( pageCopyForRsv . callout ) . toEqual ( expectedCallout ) ;
727727 } ) ;
728728
729- it ( "should not return callout section when Callout is missing" , ( ) => {
729+ it ( "should not return callout section when Callout is missing" , async ( ) => {
730730 const responseWithoutCallout = contentWithoutCallout ( ) ;
731731
732- const pageCopyForFlu : VaccinePageContent = getFilteredContentForVaccine (
732+ const pageCopyForFlu : VaccinePageContent = await getFilteredContentForVaccine (
733733 VaccineType . RSV ,
734734 JSON . stringify ( responseWithoutCallout ) ,
735735 ) ;
@@ -739,49 +739,49 @@ describe("Content Filter", () => {
739739 } ) ;
740740
741741 describe ( "for specific vaccines" , ( ) => {
742- it ( "should call getFilteredContentForWhoopingCoughVaccine for whooping cough vaccine" , ( ) => {
742+ it ( "should call getFilteredContentForWhoopingCoughVaccine for whooping cough vaccine" , async ( ) => {
743743 const mockApiContent = "testContent" ;
744744
745- getFilteredContentForVaccine ( VaccineType . WHOOPING_COUGH , mockApiContent ) ;
745+ await getFilteredContentForVaccine ( VaccineType . WHOOPING_COUGH , mockApiContent ) ;
746746
747747 expect ( buildFilteredContentForWhoopingCoughVaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
748748 } ) ;
749749
750- it ( "should call getFilteredContentForFluVaccine for flu vaccine" , ( ) => {
750+ it ( "should call getFilteredContentForFluVaccine for flu vaccine" , async ( ) => {
751751 const mockApiContent = "testContent" ;
752752
753- getFilteredContentForVaccine ( VaccineType . FLU_FOR_ADULTS , mockApiContent ) ;
753+ await getFilteredContentForVaccine ( VaccineType . FLU_FOR_ADULTS , mockApiContent ) ;
754754
755755 expect ( buildFilteredContentForFluVaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
756756 } ) ;
757757
758- it ( "should call getFilteredContentForFluInPregnancyVaccine for flu in pregnancy vaccine" , ( ) => {
758+ it ( "should call getFilteredContentForFluInPregnancyVaccine for flu in pregnancy vaccine" , async ( ) => {
759759 const mockApiContent = "testContent" ;
760760
761- getFilteredContentForVaccine ( VaccineType . FLU_IN_PREGNANCY , mockApiContent ) ;
761+ await getFilteredContentForVaccine ( VaccineType . FLU_IN_PREGNANCY , mockApiContent ) ;
762762
763763 expect ( buildFilteredContentForFluInPregnancyVaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
764764 } ) ;
765765
766- it ( "should call getFilteredContentForFluForChildrenVaccine for flu for children vaccine" , ( ) => {
766+ it ( "should call getFilteredContentForFluForChildrenVaccine for flu for children vaccine" , async ( ) => {
767767 const mockApiContent = "testContent" ;
768768
769- getFilteredContentForVaccine ( VaccineType . FLU_FOR_CHILDREN , mockApiContent ) ;
769+ await getFilteredContentForVaccine ( VaccineType . FLU_FOR_CHILDREN , mockApiContent ) ;
770770
771771 expect ( buildFilteredContentForFluForChildrenVaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
772772 } ) ;
773773
774- it ( "should return standard vaccine content and recommendation for school aged children's flu vaccine" , ( ) => {
774+ it ( "should return standard vaccine content and recommendation for school aged children's flu vaccine" , async ( ) => {
775775 const mockApiContent = "testContent" ;
776776
777- getFilteredContentForVaccine ( VaccineType . FLU_FOR_SCHOOL_AGED_CHILDREN , mockApiContent ) ;
777+ await getFilteredContentForVaccine ( VaccineType . FLU_FOR_SCHOOL_AGED_CHILDREN , mockApiContent ) ;
778778 expect ( buildFilteredContentForFluForSchoolAgedChildrenVaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
779779 } ) ;
780780
781- it ( "should call buildFilteredContentForCovid19Vaccine for flu in pregnancy vaccine" , ( ) => {
781+ it ( "should call buildFilteredContentForCovid19Vaccine for flu in pregnancy vaccine" , async ( ) => {
782782 const mockApiContent = "testContent" ;
783783
784- getFilteredContentForVaccine ( VaccineType . COVID_19 , mockApiContent ) ;
784+ await getFilteredContentForVaccine ( VaccineType . COVID_19 , mockApiContent ) ;
785785
786786 expect ( buildFilteredContentForCovid19Vaccine ) . toHaveBeenCalledWith ( mockApiContent ) ;
787787 } ) ;
0 commit comments