Skip to content

Commit

Permalink
PRMDR-528 BSOL Start Content (#172)
Browse files Browse the repository at this point in the history
Add new start content
  • Loading branch information
RioKnightleyNHS authored Nov 30, 2023
1 parent 19d17bd commit 7c9faea
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 51 deletions.
6 changes: 3 additions & 3 deletions app/cypress/e2e/0-ndr-core-tests/homepage.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('home page', () => {
cy.get('.nhsuk-header__transactional-service-name').children().should('have.length', 1);
cy.get('.nhsuk-header__transactional-service-name--link').should(
'have.text',
'Inactive Patient Record Administration',
'Access and store digital GP records',
);

cy.get('.nhsuk-header__navigation').should('have.length', 1);
Expand All @@ -41,7 +41,7 @@ describe('home page', () => {
cy.get('.nhsuk-header__transactional-service-name').children().should('have.length', 1);
cy.get('.nhsuk-header__transactional-service-name--link').should(
'have.text',
'Inactive Patient Record Administration',
'Access and store digital GP records',
);

cy.get('.nhsuk-header__navigation').should('have.length', 0);
Expand All @@ -51,7 +51,7 @@ describe('home page', () => {
it('displays correct page title on home page', () => {
cy.get('.app-homepage-content h1').should(
'have.text',
'Inactive Patient Record Administration',
'Access and store digital GP records',
);
});

Expand Down
2 changes: 1 addition & 1 deletion app/src/components/layout/header/Header.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('Header', () => {
it('navigates to the home page when header is clicked', async () => {
renderHeaderWithRouter();

userEvent.click(screen.getByText('Inactive Patient Record Administration'));
userEvent.click(screen.getByText('Access and store digital GP records'));

await waitFor(() => {
expect(mockedUseNavigate).toHaveBeenCalledWith(routes.HOME);
Expand Down
2 changes: 1 addition & 1 deletion app/src/components/layout/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Header = (props: Props) => {
<NhsHeader.Container>
<NhsHeader.Logo onClick={navigateHome} className="clickable" />
<NhsHeader.ServiceName onClick={navigateHome} className="clickable">
Inactive Patient Record Administration
Access and store digital GP records
</NhsHeader.ServiceName>
</NhsHeader.Container>

Expand Down
52 changes: 33 additions & 19 deletions app/src/pages/homePage/HomePage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,61 @@ describe('StartPage', () => {

expect(
screen.getByRole('heading', {
name: 'Inactive Patient Record Administration',
name: 'Access and store digital GP records',
}),
).toBeInTheDocument();
});

it('renders service info', () => {
it('renders home page content', () => {
const mockNavigate = jest.fn();
const mockUseNavigate = jest.fn();
mockNavigate.mockImplementation(() => mockUseNavigate);

render(<HomePage />);
const contentStrings = [
'This service gives you access to Lloyd George digital health records.',
'You can use this service if you are:',
'part of a GP practise and need to view, download or remove a patient record',
'managing records on behalf of NHS England and need to download a patient record',
'Not every patient will have a digital record available.',
'Before You Start',
"You'll be asked for:",
'your NHS smartcard',
'patient details including their name, date of birth and NHS number',
];

expect(screen.getByText(/When a patient is inactive/)).toBeInTheDocument();
expect(screen.getByText(/General Practice Staff/)).toBeInTheDocument();
expect(screen.getByText(/PCSE should use this service/)).toBeInTheDocument();
render(<HomePage />);
contentStrings.forEach((s) => {
expect(screen.getByText(s)).toBeInTheDocument();
});
expect(screen.getByText(/Contact the/i)).toBeInTheDocument();
expect(
screen.getByRole('link', {
name: /NHS National Service Desk/i,
}),
).toBeInTheDocument();
expect(
screen.getByText(/if there is an issue with this service or call 0300 303 5678/i),
).toBeInTheDocument();
});

it('renders service issue guidance with a link to service desk that opens in a new tab', () => {
it('renders a service link that takes you to service help-desk in a new tab', () => {
const mockUseNavigate = jest.fn();
mockNavigate.mockImplementation(() => mockUseNavigate);

render(<HomePage />);

expect(screen.getByText(/If there is an issue/)).toBeInTheDocument();
expect(screen.getByText(/Contact the/i)).toBeInTheDocument();
const nationalServiceDeskLink = screen.getByRole('link', {
name: /National Service Desk/,
name: /NHS National Service Desk/i,
});
expect(
screen.getByText(/if there is an issue with this service or call 0300 303 5678/i),
).toBeInTheDocument();

expect(nationalServiceDeskLink).toHaveAttribute(
'href',
'https://digital.nhs.uk/about-nhs-digital/contact-us#nhs-digital-service-desks',
);
expect(nationalServiceDeskLink).toHaveAttribute('target', '_blank');
});

it("renders a 'Before you start' section", () => {
const mockUseNavigate = jest.fn();
mockNavigate.mockImplementation(() => mockUseNavigate);

render(<HomePage />);

expect(screen.getByRole('heading', { name: 'Before You Start' })).toBeInTheDocument();
expect(screen.getByText(/valid NHS smartcard/)).toBeInTheDocument();
});
});
55 changes: 28 additions & 27 deletions app/src/pages/homePage/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,42 @@ function HomePage(props: Props) {
};
return !isLoading ? (
<>
<h1>Inactive Patient Record Administration</h1>
<p>
When a patient is inactive, NHS England via Primary Care Support England are
responsible for administration of their Electronic health record (EHR) and
attachments until they register at their next GP Practice.
</p>
<p>
General Practice Staff should use this service to upload an inactive patient&apos;s
electronic health record and attachments.
</p>
<p>
PCSE should use this service to search for and download patient records where there
has been an access request for an inactive patient health record.
</p>
<p>
If there is an issue with the service please contact the{' '}
<a
href="https://digital.nhs.uk/about-nhs-digital/contact-us#nhs-digital-service-desks"
target="_blank"
rel="noreferrer"
>
NHS National Service Desk
</a>
.
</p>
<h1>Access and store digital GP records</h1>
<p>This service gives you access to Lloyd George digital health records.</p>
<p>You can use this service if you are:</p>
<ul>
<li>part of a GP practise and need to view, download or remove a patient record</li>
<li>
managing records on behalf of NHS England and need to download a patient record
</li>
</ul>
<p>Not every patient will have a digital record available.</p>
<h2>Before You Start</h2>
<p>You can only use this service if you have a valid NHS smartcard.</p>
<p>You'll be asked for:</p>
<ul>
<li>your NHS smartcard</li>
<li>patient details including their name, date of birth and NHS number</li>
</ul>
<ButtonLink role="button" id="start-button" onClick={handleLogin}>
Start now
</ButtonLink>
<h3>Get support with the service</h3>
{'Contact the '}
<a
href="https://digital.nhs.uk/about-nhs-digital/contact-us#nhs-digital-service-desks"
target="_blank"
rel="noreferrer"
>
NHS National Service Desk
</a>
{' if there is an issue with this service or call 0300 303 5678'}
{(process.env.REACT_APP_ENVIRONMENT === 'local' ||
process.env.REACT_APP_ENVIRONMENT === 'development' ||
process.env.REACT_APP_ENVIRONMENT === 'test') && (
<div>
<br></br>
<br />
<br />
<br />
<h2>Test Panel</h2>
<p>
This section should only be displayed on a test/dev environment and should
Expand Down

0 comments on commit 7c9faea

Please sign in to comment.