Commit 691f4b5 Matthew Kwong
committed
1 parent 7d4bac3 commit 691f4b5 Copy full SHA for 691f4b5
File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ describe('Download CV', () => {
17
17
beforeEach ( ( ) => cy . visit ( home . pathname ) ) ;
18
18
19
19
it ( 'should open CV in a new tab (for browsers with PDF reader built-in)' , ( ) => {
20
- const href = `https:${ ctx . cv } ` ;
20
+ if ( ctx . cv ) {
21
+ cy . contains ( 'Download CV' )
22
+ . should ( 'have.attr' , 'target' , '_blank' )
23
+ . should ( 'have.attr' , 'href' , ctx . cv ) ;
21
24
22
- cy . contains ( 'Download CV' )
23
- . should ( 'have.attr' , 'target' , '_blank' )
24
- . should ( 'have.attr' , 'href' , href ) ;
25
-
26
- cy . request ( href )
27
- . its ( 'headers' )
28
- . should ( 'have.a.property' , 'content-type' , 'application/pdf' ) ;
25
+ cy . request ( ctx . cv )
26
+ . its ( 'headers' )
27
+ . should ( 'have.a.property' , 'content-type' , 'application/pdf' ) ;
28
+ }
29
29
} ) ;
30
30
} ) ;
You can’t perform that action at this time.
0 commit comments