Skip to content

Commit

Permalink
fix: make the 'Resume application' button a real anchor link
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscooke committed Mar 17, 2021
1 parent 59c8022 commit fb96c64
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
29 changes: 14 additions & 15 deletions app/containers/Applications/ApplyButtonContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,21 @@ export const ApplyButton: React.FunctionComponent<Props> = ({
latestDraftRevision?.legalDisclaimerAccepted;

if (applicationStatus === 'DRAFT') {
const continueApplication = () => {
router.push({
pathname: latestDraftlegalDisclaimerAccepted
? '/reporter/application'
: '/reporter/new-application-disclaimer',
query: {
applicationId,
version: latestDraftVersionNumber
}
});
};

return (
<Button variant="primary" onClick={continueApplication}>
Resume CIIP application
</Button>
<Link
passHref
href={{
pathname: latestDraftlegalDisclaimerAccepted
? '/reporter/application'
: '/reporter/new-application-disclaimer',
query: {
applicationId,
version: latestDraftVersionNumber
}
}}
>
<Button variant="primary">Resume CIIP application</Button>
</Link>
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/cypress/integration/reporter-access-all-pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('When logged in as a reporter', () => {
cy.get('tr');
cy.contains('View Facilities').click();
cy.url().should('include', '/reporter/facilities');
cy.get('tbody > tr:nth-child(2) button')
cy.get('tbody > tr:nth-child(2) .btn')
.contains('Resume CIIP application')
.click();
cy.url().should('include', '/reporter/new-application-disclaimer');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`The apply button should render a Resume Application button if an application revision exists with draft status and the application window is open 1`] = `
<Button
active={false}
disabled={false}
onClick={[Function]}
variant="primary"
<Link
href={
Object {
"pathname": "/reporter/new-application-disclaimer",
"query": Object {
"applicationId": "foo",
"version": 1,
},
}
}
passHref={true}
>
Resume CIIP application
</Button>
<Button
active={false}
disabled={false}
variant="primary"
>
Resume CIIP application
</Button>
</Link>
`;

exports[`The apply button should render a View Application button if an application revision exists with approved status 1`] = `
Expand Down

0 comments on commit fb96c64

Please sign in to comment.