1
- import { expect } from 'chai' ;
2
-
3
1
const verifyActionLink = ( expectedText , expectedHref ) =>
4
2
cy
5
3
. get ( 'va-link-action' )
@@ -16,10 +14,10 @@ describe('VAMC Lovell - All TRICARE pages with expected MHS Genesis Patient Port
16
14
cy . visit ( '/lovell-federal-health-care-tricare/' ) ;
17
15
cy . injectAxeThenAxeCheck ( ) ;
18
16
19
- cy . findByText ( 'MHS Genesis Patient Portal' ) . then ( el => {
20
- const attr = el . attr ( 'href' ) ;
21
- expect ( attr ) . to . equal ( 'https://my.mhsgenesis.health.mil/' ) ;
22
- } ) ;
17
+ verifyActionLink (
18
+ 'MHS Genesis Patient Portal' ,
19
+ 'https://my.mhsgenesis.health.mil/' ,
20
+ ) ;
23
21
} ) ;
24
22
25
23
it ( 'TRICARE Health services has MHS Genesis Patient Portal link' , ( ) => {
@@ -36,10 +34,10 @@ describe('VAMC Lovell - All TRICARE pages with expected MHS Genesis Patient Port
36
34
cy . visit ( '/lovell-federal-health-care-tricare/locations' ) ;
37
35
cy . injectAxeThenAxeCheck ( ) ;
38
36
39
- cy . findByText ( 'MHS Genesis Patient Portal' ) . then ( el => {
40
- const attr = el . attr ( 'href' ) ;
41
- expect ( attr ) . to . equal ( 'https://my.mhsgenesis.health.mil/' ) ;
42
- } ) ;
37
+ verifyActionLink (
38
+ 'MHS Genesis Patient Portal' ,
39
+ 'https://my.mhsgenesis.health.mil/' ,
40
+ ) ;
43
41
} ) ;
44
42
45
43
it ( 'TRICARE Captain James A. Lovell Location has MHS Genesis Patient Portal link' , ( ) => {
@@ -60,10 +58,10 @@ describe('VAMC Lovell - All VA pages with expected Make an appointment Top Task
60
58
cy . visit ( '/lovell-federal-health-care-va/' ) ;
61
59
cy . injectAxeThenAxeCheck ( ) ;
62
60
63
- cy . findByText ( 'Make an appointment' ) . then ( el => {
64
- const attr = el . attr ( 'href' ) ;
65
- expect ( attr . endsWith ( ' make-an-appointment') ) . to . be . true ;
66
- } ) ;
61
+ verifyActionLink (
62
+ 'Make an appointment' ,
63
+ '/lovell-federal-health-care-va/ make-an-appointment',
64
+ ) ;
67
65
} ) ;
68
66
69
67
it ( 'VA Health services has Make an appointment link' , ( ) => {
@@ -80,10 +78,10 @@ describe('VAMC Lovell - All VA pages with expected Make an appointment Top Task
80
78
cy . visit ( '/lovell-federal-health-care-va/locations/' ) ;
81
79
cy . injectAxeThenAxeCheck ( ) ;
82
80
83
- cy . findByText ( 'Make an appointment' ) . then ( el => {
84
- const attr = el . attr ( 'href' ) ;
85
- expect ( attr . endsWith ( ' make-an-appointment') ) . to . be . true ;
86
- } ) ;
81
+ verifyActionLink (
82
+ 'Make an appointment' ,
83
+ '/lovell-federal-health-care-va/ make-an-appointment',
84
+ ) ;
87
85
} ) ;
88
86
89
87
it ( 'VA Captain James A. Lovell Location has Make an appointment link' , ( ) => {
0 commit comments