mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 09:56:51 +01:00
Matthias Kretschmann
05ad0470c2
* migrate to biome * cleanup * fix * use tsx * script tweaks * fix test runs * path tweaks
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import config from '@config/blog.config'
|
|
import { expect, test } from '@playwright/test'
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await page.goto('/')
|
|
})
|
|
|
|
test('meta is correct', async ({ page }) => {
|
|
await expect(page).toHaveTitle(RegExp(`${config.siteDescription}`, 'g'))
|
|
await expect(page.locator('meta[property="og:title"]')).toHaveAttribute(
|
|
'content',
|
|
RegExp(`${config.siteDescription}`, 'g')
|
|
)
|
|
await expect(page.locator('link[rel="canonical"]')).toHaveAttribute(
|
|
'href',
|
|
config.siteUrl
|
|
)
|
|
await expect(page.locator('meta[property="og:url"]')).toHaveAttribute(
|
|
'content',
|
|
config.siteUrl
|
|
)
|
|
await expect(page.locator('meta[name="description"]')).toHaveAttribute(
|
|
'content',
|
|
config.siteDescription
|
|
)
|
|
})
|
|
|
|
test('has articles & photos heading', async ({ page }) => {
|
|
// Click the get started link.
|
|
// await page.getByRole('link', { name: 'Get started' }).click()
|
|
|
|
// Expects page to have a heading with the name of Articles & Photos.
|
|
await expect(page.getByRole('heading', { name: 'Articles' })).toBeVisible()
|
|
await expect(page.getByRole('heading', { name: 'Photos' })).toBeVisible()
|
|
})
|