Skip to content

Commit

Permalink
EES-5219 run format
Browse files Browse the repository at this point in the history
  • Loading branch information
rian.thwaite committed Jan 9, 2025
1 parent 0d18dd9 commit b3ab313
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ interface Props {
}

const PublicationSummary = ({ publication }: Props) => {
const { published, slug, summary, theme, title, type, releaseSlug } = publication;
const { published, slug, summary, theme, title, type, releaseSlug } =
publication;
return (
<li className={`${styles.container} govuk-!-margin-top-4`}>
<h3 className="govuk-!-margin-bottom-2">
<Link to={
publication.releaseSlug
? `/find-statistics/${slug}/${releaseSlug}`
: `/find-statistics/${slug}`
}>{title}</Link>
<Link
to={
publication.releaseSlug
? `/find-statistics/${slug}/${releaseSlug}`
: `/find-statistics/${slug}`
}
>
{title}
</Link>
</h3>
<p>{summary}</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ const MethodologyPage: NextPage<Props> = ({ data }) => {
<ul className="govuk-list govuk-list--spaced">
{data.publications.map(publication => (
<li key={publication.id}>
<Link to={
publication.releaseSlug
? `/find-statistics/${publication.slug}/${publication.releaseSlug}`
: `/find-statistics/${publication.slug}`
}>
<Link
to={
publication.releaseSlug
? `/find-statistics/${publication.slug}/${publication.releaseSlug}`
: `/find-statistics/${publication.slug}`
}
>
{publication.title}
</Link>{' '}
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ const TableToolFinalStep = ({
<Link
className="govuk-!-display-none-print"
unvisited
to=
{
selectedPublication.selectedRelease && selectedPublication.latestRelease
? `/find-statistics/${selectedPublication.slug}/${selectedPublication.selectedRelease.slug}`
: `/find-statistics/${selectedPublication.slug}`
to={
selectedPublication.selectedRelease &&
selectedPublication.latestRelease
? `/find-statistics/${selectedPublication.slug}/${selectedPublication.selectedRelease.slug}`
: `/find-statistics/${selectedPublication.slug}`
}
testId="View latest data link"
>
Expand Down Expand Up @@ -185,8 +185,11 @@ const TableToolFinalStep = ({
methodologyLinks={getMethodologyLinks()}
releaseLink={
<>
{selectedPublication.selectedRelease.slug && selectedPublication.latestRelease ? (
<Link to={`/find-statistics/${selectedPublication.slug}/${selectedPublication.selectedRelease.slug}`}>
{selectedPublication.selectedRelease.slug &&
selectedPublication.latestRelease ? (
<Link
to={`/find-statistics/${selectedPublication.slug}/${selectedPublication.selectedRelease.slug}`}
>
{`${selectedPublication.title}, ${selectedPublication.selectedRelease.title}`}
</Link>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ describe('TableToolFinalStep', () => {
screen.getByRole('link', {
name: 'Test publication, Latest Release Title',
}),
).toHaveAttribute('href', '/find-statistics/test-publication/latest-release-slug');
).toHaveAttribute(
'href',
'/find-statistics/test-publication/latest-release-slug',
);
});

test('renders correctly when this is the latest data', async () => {
Expand Down Expand Up @@ -224,7 +227,10 @@ describe('TableToolFinalStep', () => {
screen.getByRole('link', {
name: 'View latest data: Latest Release Title',
}),
).toHaveAttribute('href', '/find-statistics/test-publication/selected-release-slug');
).toHaveAttribute(
'href',
'/find-statistics/test-publication/selected-release-slug',
);

expect(
screen.getByRole('link', {
Expand Down

0 comments on commit b3ab313

Please sign in to comment.