@@ -29,10 +29,13 @@ test.describe("Eligibility", () => {
2929 level : 2 ,
3030 name : "We do not believe you can have it" ,
3131 } ) ;
32- const bulletPoint1 : Locator = eligibility . getByText ( "are not aged 75 to 79" , { exact : true } ) . first ( ) ;
33- const bulletPoint2 : Locator = eligibility
34- . getByText ( elidCopyForEnvironment . user15 . bulletPoint2 , { exact : true } )
35- . first ( ) ;
32+
33+ const bulletPoint1RegEx = new RegExp ( `(are not aged 75 to 79|are not aged 75 or over)` ) ;
34+ const bulletPoint2RegEx = new RegExp (
35+ `(${ elidCopyForEnvironment . user15 . bulletPoint2v1 } |${ elidCopyForEnvironment . user15 . bulletPoint2v2 } )` ,
36+ ) ;
37+ const bulletPoint1 : Locator = eligibility . getByText ( bulletPoint1RegEx , { exact : true } ) . first ( ) ;
38+ const bulletPoint2 : Locator = eligibility . getByText ( bulletPoint2RegEx , { exact : true } ) . first ( ) ;
3639
3740 await expect ( heading ) . toBeVisible ( ) ;
3841 await expect ( bulletPoint1 ) . toBeVisible ( ) ;
@@ -74,9 +77,11 @@ test.describe("Eligibility", () => {
7477
7578 const eligibility : Locator = page . getByTestId ( "Eligibility" ) ;
7679 const heading : Locator = eligibility . getByRole ( "heading" , { level : 2 , name : "You should have the RSV vaccine" } ) ;
77- const bulletPoint : Locator = eligibility
78- . getByText ( elidCopyForEnvironment . user01 . bulletPoint1 , { exact : true } )
79- . first ( ) ;
80+
81+ const bulletPoint1RegEx = new RegExp (
82+ `(${ elidCopyForEnvironment . user01 . bulletPoint1v1 } |${ elidCopyForEnvironment . user01 . bulletPoint1v2 } )` ,
83+ ) ;
84+ const bulletPoint : Locator = eligibility . getByText ( bulletPoint1RegEx , { exact : true } ) . first ( ) ;
8085
8186 await expect ( heading ) . toBeVisible ( ) ;
8287 await expect ( bulletPoint ) . toBeVisible ( ) ;
0 commit comments