diff --git a/tests/blog-page.spec.js b/tests/blog-page.spec.js index 64274f5..b351196 100644 --- a/tests/blog-page.spec.js +++ b/tests/blog-page.spec.js @@ -34,6 +34,12 @@ test.describe("blog page", () => { await expect(firstCard.locator(".post-list__title")).toBeVisible(); await expect(firstCard.locator(".post-list__byline")).toBeVisible(); + // First card has a "Read more" link. + const readMore = firstCard.locator(".post-list__read-more"); + await expect(readMore).toBeVisible(); + await expect(readMore).toHaveText(/^Read more\s*\S+$/); + await expect(readMore).toHaveAttribute("href", /\/[a-z0-9-]+\/?$/); + // First card does NOT have a categories row or an excerpt. expect(await firstCard.locator(".post-list__cats").count()).toBe(0); expect(await firstCard.locator(".post-list__excerpt").count()).toBe(0);