mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
* chore(workflow): align local hooks and e2e guidance * test(e2e): expand reusable api mock helpers * test(skill): stabilize share button e2e assertions * chore(test): add e2e make target and tune playwright workers * test(web): expand e2e coverage and smoke suite * test(e2e): migrate to real API flows and add request-based data builder * ci(e2e): add PR workflow for real-service frontend e2e * ci(e2e): install playwright chromium in PR workflow * test(e2e): relax timeout and force single worker in CI * test(e2e): stabilize not-found assertions and harden CI session bootstrap * chore(agents): align tester role with web/e2e workflow
22 lines
815 B
TypeScript
22 lines
815 B
TypeScript
import { expect, test } from '@playwright/test'
|
|
import { setEnglishLocale } from './helpers/auth-fixtures'
|
|
|
|
test.describe('Protected Routes (Real API)', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await setEnglishLocale(page)
|
|
})
|
|
|
|
test('redirects anonymous users from dashboard and admin routes', async ({ page }) => {
|
|
await page.goto('/dashboard/publish')
|
|
await expect(page).toHaveURL(/\/login\?returnTo=%2Fdashboard%2Fpublish$/)
|
|
|
|
await page.goto('/dashboard/governance')
|
|
await expect(page).toHaveURL(/\/login\?returnTo=%2Fdashboard%2Fgovernance$/)
|
|
|
|
await page.goto('/dashboard/reviews')
|
|
await expect(page).toHaveURL(/\/login\?returnTo=%2Fdashboard%2Freviews$/)
|
|
|
|
await page.goto('/admin/users')
|
|
await expect(page).toHaveURL(/\/login\?returnTo=%2Fadmin%2Fusers$/)
|
|
})
|
|
})
|