From 5eacc8498d0c9108a27f04fdd5aea2a90e7bc65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Gr=C3=B8tan=20Gregusson?= Date: Mon, 29 Apr 2024 13:11:18 +0200 Subject: [PATCH] test(frontend): :white_check_mark: Fix blog test --- frontend/src/components/fullBlogCard.tsx | 6 ++++-- frontend/tests/componentTests/fullblogcard.spec.tsx | 13 +------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/fullBlogCard.tsx b/frontend/src/components/fullBlogCard.tsx index 6ab512e..9f54319 100644 --- a/frontend/src/components/fullBlogCard.tsx +++ b/frontend/src/components/fullBlogCard.tsx @@ -48,8 +48,8 @@ export default function FullBlogCard({ return ( @@ -77,7 +77,9 @@ export default function FullBlogCard({ {formatDate(article.datePublished)}

- {article.title} + + {article.title} +

diff --git a/frontend/tests/componentTests/fullblogcard.spec.tsx b/frontend/tests/componentTests/fullblogcard.spec.tsx index 16b2ebf..303e85e 100644 --- a/frontend/tests/componentTests/fullblogcard.spec.tsx +++ b/frontend/tests/componentTests/fullblogcard.spec.tsx @@ -30,7 +30,7 @@ test("FullBlogCard renders correctly", async ({ mount }) => { await expect(component).toBeVisible(); //Check if title is correct - await expect(component.getByTestId("blogCardLink")).toContainText( + await expect(component.getByTestId("blogCardTitle")).toContainText( "Mock Article Title", ); @@ -50,15 +50,4 @@ test("FullBlogCard renders correctly", async ({ mount }) => { //Check if the tag is correct await expect(component.getByTestId("articleTag")).toHaveText("Projects"); - - //Check if the urls on the links are correct - await expect(component.getByTestId("blogCardLink")).toHaveAttribute( - "href", - "/blog/mock-article-slug", - ); - - await expect(component.getByText("Read more")).toHaveAttribute( - "href", - "/blog/mock-article-slug", - ); });