Skip to content

Commit

Permalink
fix(article card): updates links to /posts
Browse files Browse the repository at this point in the history
Updates the ArticleCard to point to the /posts route
  • Loading branch information
anguspiv committed Nov 15, 2022
1 parent cb03e36 commit e596baa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/molecules/ArticleCard/ArticleCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export function ArticleCard({ date, excerpt, featured, readingTime, slug, title
const formattedDate = formatDate(date);

return (
<Link href={`/articles/${slug}`} passHref>
<Link href={`/posts/${slug}`} passHref>
<a
href={`/articles/${slug}`}
href={`/posts/${slug}`}
data-testid="article-card"
css={css`
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/ArticleCard/ArticleCard.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('<ArticleCard />', () => {
});
expect(screen.getByText('Jan. 1st, 2021')).toBeInTheDocument();
expect(screen.getByText(`${readingTime} min. read`)).toBeInTheDocument();
expect(screen.getByRole('link')).toHaveAttribute('href', `/articles/${slug}`);
expect(screen.getByRole('link')).toHaveAttribute('href', `/posts/${slug}`);
});

it('renders a featured article card', () => {
Expand Down Expand Up @@ -63,6 +63,6 @@ describe('<ArticleCard />', () => {
});
expect(screen.getByText('Jan. 1st, 2021')).toBeInTheDocument();
expect(screen.getByText(`${readingTime} min. read`)).toBeInTheDocument();
expect(screen.getByRole('link')).toHaveAttribute('href', `/articles/${slug}`);
expect(screen.getByRole('link')).toHaveAttribute('href', `/posts/${slug}`);
});
});

0 comments on commit e596baa

Please sign in to comment.