fix: migrations, auth, providers health check, E2E tests, remove neko-sama
- Add proper Alembic initial migration (0001_initial_schema.py) - Migrate refresh tokens from JSON file to SQLite (RefreshTokenTable) - Remove Neko-Sama provider entirely (redirects to Gupy, not a host) - Fix provider health check always showing UNKNOWN - Run check_all_health() on startup - Fix POST /providers/health/check background task bug - Add HTMX refresh after manual health check trigger - Fix anime search relevance scoring with MIN_RELEVANCE_THRESHOLD=0.5 - Replace bare 'except:' with 'except Exception:' across codebase - Add Playwright E2E test suite (12 tests, auth setup, helpers) - Fix toast container blocking clicks via pointer-events: none - Remove obsolete Jest/Vite test files and config - Clean up obsolete test_watchlist scripts - Update sonarr model comment for active providers
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Global setup for E2E tests.
|
||||
* Creates a predictable test user so auth tests don't fail on missing accounts.
|
||||
* Uses native fetch to avoid conflicts with vitest.
|
||||
*/
|
||||
export default async function globalSetup() {
|
||||
const baseURL = process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:3000';
|
||||
|
||||
const testUser = {
|
||||
username: 'e2e_testuser',
|
||||
password: 'TestPassword123!',
|
||||
email: 'e2e@example.com',
|
||||
full_name: 'E2E Test User',
|
||||
};
|
||||
|
||||
// Try to register the test user (ignore 400 if already exists)
|
||||
const resp = await fetch(`${baseURL}/api/auth/register`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(testUser),
|
||||
});
|
||||
|
||||
if (resp.ok || resp.status === 400) {
|
||||
console.log(`[global-setup] Test user "${testUser.username}" ready`);
|
||||
} else {
|
||||
const body = await resp.text().catch(() => '');
|
||||
console.warn(`[global-setup] Register returned ${resp.status}: ${body}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user