From 08e58f2f12a86ac0cb54b0a6a6861857ffd7f9cf Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Tue, 17 Dec 2024 07:26:38 +0000 Subject: [PATCH 1/5] [PRMP-1330] - Add service-updates-link to footer --- .../ServiceUpdatesLink.test.tsx | 18 ++++++++++++++++++ .../serviceUpdatesLink/ServiceUpdatesLink.tsx | 17 +++++++++++++++++ app/src/components/layout/footer/Footer.tsx | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.test.tsx create mode 100644 app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx diff --git a/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.test.tsx b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.test.tsx new file mode 100644 index 000000000..c40360b83 --- /dev/null +++ b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.test.tsx @@ -0,0 +1,18 @@ +import { render, screen } from '@testing-library/react'; +import ServiceUpdatesLink from './ServiceUpdatesLink'; + +describe('Service updates link', () => { + it('renders a service updates link that opens in a new tab', () => { + render(); + + const serviceUpdatesLink = screen.getByRole('link', { + name: /Service updates/i, + }); + + expect(serviceUpdatesLink).toHaveAttribute( + 'href', + 'https://digital.nhs.uk/services/access-and-store-digital-patient-documents/service-updates', + ); + expect(serviceUpdatesLink).toHaveAttribute('target', '_blank'); + }); +}); diff --git a/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx new file mode 100644 index 000000000..bdba742db --- /dev/null +++ b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx @@ -0,0 +1,17 @@ +import { Footer as NHSFooter } from 'nhsuk-react-components'; + +const ServiceUpdatesLink = () => { + return ( + + Service updates + + ); +}; + +export default ServiceUpdatesLink; diff --git a/app/src/components/layout/footer/Footer.tsx b/app/src/components/layout/footer/Footer.tsx index f1a0e46e4..1c93fb6e8 100644 --- a/app/src/components/layout/footer/Footer.tsx +++ b/app/src/components/layout/footer/Footer.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Footer as NHSFooter } from 'nhsuk-react-components'; import { routes } from '../../../types/generic/routes'; +import ServiceUpdatesLink from '../../generic/serviceUpdatesLink/ServiceUpdatesLink'; function Footer() { return ( @@ -15,6 +16,7 @@ function Footer() { > Privacy notice + © {'Crown copyright'} From 9eabba86acbe4338bec8de7fd068b6f11e51b5e3 Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Wed, 18 Dec 2024 11:22:48 +0000 Subject: [PATCH 2/5] [PRMP-1330] - Remove brackets in aria-label for screen readers --- .../generic/serviceUpdatesLink/ServiceUpdatesLink.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx index bdba742db..fef1f81d9 100644 --- a/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx +++ b/app/src/components/generic/serviceUpdatesLink/ServiceUpdatesLink.tsx @@ -7,7 +7,7 @@ const ServiceUpdatesLink = () => { data-testid="service-updates-link" rel="noopener" target="_blank" - aria-label="(Service updates - Opens in a new tab)" + aria-label="Service updates - Opens in a new tab" > Service updates From e23cdd1377ed6e9208055cdf9044ee49260c2f4e Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Thu, 19 Dec 2024 15:58:02 +0000 Subject: [PATCH 3/5] [PRMP-1330] - Add test for rendering service-updates-link --- app/src/components/layout/footer/Footer.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/components/layout/footer/Footer.test.tsx b/app/src/components/layout/footer/Footer.test.tsx index 258b5728c..40450f578 100644 --- a/app/src/components/layout/footer/Footer.test.tsx +++ b/app/src/components/layout/footer/Footer.test.tsx @@ -8,6 +8,10 @@ describe('Footer', () => { render(