BS-007 Implement accepted Contact page and independent enquiry service
This commit is contained in:
@@ -4,14 +4,14 @@ import { expect, test } from '@playwright/test'
|
||||
for (const [path, heading] of [
|
||||
['/', /Software solutions\s*for real-world use\./], ['/services', 'Services'],
|
||||
['/projects', 'Projects'], ['/projects/example', 'Project details'],
|
||||
['/about', 'About BortStack'], ['/contact', 'Contact'], ['/privacy', 'Privacy policy'],
|
||||
['/about', 'About BortStack'], ['/contact', 'Have a project in mind?'], ['/privacy', 'Privacy policy'],
|
||||
['/login', 'Page not found'], ['/dashboard', 'Page not found'],
|
||||
]) {
|
||||
test(`${path} renders without overflow or auth requests`, async ({ page }) => {
|
||||
const errors = []
|
||||
const accountRequests = []
|
||||
page.on('pageerror', error => errors.push(error.message))
|
||||
page.on('request', request => { if (/\/api\//.test(request.url())) accountRequests.push(request.url()) })
|
||||
page.on('request', request => { if (/\/api\//.test(request.url()) && !request.url().endsWith('/api/contact/config')) accountRequests.push(request.url()) })
|
||||
await page.goto(path)
|
||||
await expect(page.getByRole('heading', { name: heading, exact: true })).toBeVisible()
|
||||
expect(await page.locator('html').evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user