feat: complete server-backed six-lesson app and trial tooling
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
import { registerViaUi, uniqueUsername } from './helpers/auth'
|
||||
|
||||
test.describe('UI quality', () => {
|
||||
test('no unexpected console errors on home and RTL layout', async ({ page }) => {
|
||||
const errors: string[] = []
|
||||
page.on('pageerror', (err) => errors.push(err.message))
|
||||
page.on('console', (msg) => {
|
||||
if (msg.type() === 'error') errors.push(msg.text())
|
||||
})
|
||||
|
||||
const user = uniqueUsername('ui')
|
||||
await registerViaUi(page, user, 'pass1234')
|
||||
const bodyDir = await page.evaluate(() => getComputedStyle(document.body).direction)
|
||||
expect(bodyDir).toBe('rtl')
|
||||
|
||||
const overflow = await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 2)
|
||||
expect(overflow).toBe(false)
|
||||
|
||||
const filtered = errors.filter(
|
||||
(e) => !e.includes('favicon') && !e.includes('DevTools') && !e.includes('404'),
|
||||
)
|
||||
expect(filtered).toEqual([])
|
||||
})
|
||||
|
||||
test('keyboard focus reaches login username field', async ({ page }) => {
|
||||
await page.goto('/login')
|
||||
await page.getByLabel('نام کاربری').focus()
|
||||
await expect(page.getByLabel('نام کاربری')).toBeFocused()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user