Files
zpan/e2e/responsive-trash.spec.ts
T
Jasper Van 0b65e2dc15 [v2.6] Integrate zpan with new cloud order flow and complete migration cleanup
fix(store): guard cloud order actions by org
2026-05-08 15:42:05 -04:00

40 lines
1.5 KiB
TypeScript

import { expect, test } from '@playwright/test'
import { expandSignUpForm } from './helpers'
// Helper: register and go to recycle bin
async function signUpAndGoToTrash(page: import('@playwright/test').Page) {
await page.goto('/sign-up')
await expandSignUpForm(page)
await page.getByLabel('Email').fill(`trash-${Date.now()}@example.com`)
await page.getByLabel('Username').fill(`trash${Date.now()}`)
await page.getByLabel('Password').fill('password123456')
const [resp] = await Promise.all([
page.waitForResponse((r) => r.url().includes('/api/auth/sign-up')),
page.getByRole('button', { name: 'Sign up' }).click(),
])
expect(resp.status()).toBe(200)
await expect(page).toHaveURL(/files/, { timeout: 10000 })
await page.goto('/trash')
await expect(page).toHaveURL(/trash/, { timeout: 10000 })
}
// ---------------------------------------------------------------------------
// Recycle bin page responsive
// ---------------------------------------------------------------------------
test.describe('Recycle bin responsive layout', () => {
test('recycle bin has no horizontal overflow @all', async ({ page }) => {
await signUpAndGoToTrash(page)
const hasHScroll = await page.evaluate(
() => document.documentElement.scrollWidth > document.documentElement.clientWidth,
)
expect(hasHScroll).toBe(false)
})
test('mobile: empty trash action is accessible @mobile', async ({ page }) => {
await signUpAndGoToTrash(page)
await expect(page.getByRole('button', { name: /empty/i })).toBeVisible()
})
})