Skip to content

Commit 691f4b5

Browse files
author
Matthew Kwong
committed
test: fix expected CV URL
1 parent 7d4bac3 commit 691f4b5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cypress/e2e/download-cv.cy.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ describe('Download CV', () => {
1717
beforeEach(() => cy.visit(home.pathname));
1818

1919
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);
2124

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+
}
2929
});
3030
});

0 commit comments

Comments
 (0)