test(blog): assert Read more link is present in the first card
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user