diff --git a/site/gatsby-site/cypress/e2e/integration/cite.cy.js b/site/gatsby-site/cypress/e2e/integration/cite.cy.js index 0e5a05dc25..d74563d240 100644 --- a/site/gatsby-site/cypress/e2e/integration/cite.cy.js +++ b/site/gatsby-site/cypress/e2e/integration/cite.cy.js @@ -337,6 +337,16 @@ describe('Cite pages', () => { cy.contains('Previous Incident').should('be.visible').should('have.attr', 'href', '/cite/9'); }); + it('Should render the header next/previous buttons', () => { + cy.visit(url); + cy.get(`[data-cy="header-previous-incident-link"]`) + .should('be.visible') + .should('have.attr', 'href', '/cite/9'); + cy.get(`[data-cy="header-next-incident-link"]`) + .should('be.visible') + .should('have.attr', 'href', '/cite/11'); + }); + it('Should disable Previous and Next incident buttons on first and last incidents', () => { cy.visit('/cite/1'); @@ -361,6 +371,24 @@ describe('Cite pages', () => { }); }); + it('Should disable Previous and Next incident buttons in header on first and last incidents', () => { + cy.visit('/cite/1'); + + cy.get(`[data-cy="header-previous-incident-link"]`).should('not.exist'); + + cy.get(`[data-cy="header-next-incident-link"]`) + .should('be.visible') + .should('have.attr', 'href', '/cite/2'); + + cy.visit(`/cite/${lastIncidentId}`); + + cy.get(`[data-cy="header-next-incident-link"]`).should('not.exist'); + + cy.get(`[data-cy="header-previous-incident-link"]`) + .should('be.visible') + .should('have.attr', 'href', `/cite/${lastIncidentId - 1}`); + }); + maybeIt('Should show the edit incident form', () => { cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword')); diff --git a/site/gatsby-site/src/templates/citeTemplate.js b/site/gatsby-site/src/templates/citeTemplate.js index f94ddbafe3..2e99eae2d3 100644 --- a/site/gatsby-site/src/templates/citeTemplate.js +++ b/site/gatsby-site/src/templates/citeTemplate.js @@ -24,7 +24,12 @@ import { SUBSCRIPTION_TYPE } from 'utils/subscriptions'; import VariantList from 'components/variants/VariantList'; import Tools from 'components/cite/Tools'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { faArrowLeft, faArrowRight } from '@fortawesome/free-solid-svg-icons'; +import { + faCircleArrowLeft, + faCircleArrowRight, + faArrowLeft, + faArrowRight, +} from '@fortawesome/free-solid-svg-icons'; import ClassificationsEditor from 'components/taxa/ClassificationsEditor'; import ClassificationsDisplay from 'components/taxa/ClassificationsDisplay'; @@ -176,11 +181,40 @@ function CiteTemplate({ )} {!readOnly && ( - + <> + + +
+ + + + + + +
+ )} @@ -347,12 +381,11 @@ function CiteTemplate({ className="xl:hidden" /> )} - {!readOnly && (