Add Vitest unit tests and Playwright e2e suite for frontend
Replaces the ad-hoc test-e2e.mjs scripts with a proper test stack: Vitest covers $lib (api, auth, signalr) with mocked fetch/SignalR/navigation, and @playwright/test covers auth, stores, lists, recipes, and SignalR realtime sync between two browser contexts. Tests use uniqueName() for every entity since the backend has no per-test reset. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { defineConfig, devices } from '@playwright/test';
|
||||
|
||||
export default defineConfig({
|
||||
testDir: './tests/e2e',
|
||||
fullyParallel: false,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: 0,
|
||||
reporter: 'html',
|
||||
timeout: 30_000,
|
||||
expect: {
|
||||
timeout: 8_000
|
||||
},
|
||||
use: {
|
||||
baseURL: 'http://localhost:5173',
|
||||
trace: 'on-first-retry'
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
use: {
|
||||
...devices['Pixel 5'],
|
||||
viewport: { width: 390, height: 844 }
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
Reference in New Issue
Block a user