refactors

This commit is contained in:
counterweight 2025-12-26 20:04:46 +01:00
parent 4e1a339432
commit 82c4d0168e
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
28 changed files with 1042 additions and 782 deletions

View file

@ -22,13 +22,12 @@ test.beforeEach(async ({ context, request }, testInfo) => {
process.env.NEXT_PUBLIC_API_URL = backendUrl;
// Reset database before each test for isolation
try {
await resetDatabase(request);
} catch (error) {
// If reset fails, log but don't fail the test
// This allows tests to run even if reset endpoint is unavailable
console.warn(`Failed to reset database: ${error}`);
}
// This must complete successfully before tests run to avoid race conditions
await resetDatabase(request);
// Small delay to ensure database transaction commits are visible
// This prevents race conditions where tests start before reset completes
await new Promise((resolve) => setTimeout(resolve, 100));
// Add init script to set English language before any page loads
// This must be called before any page.goto() calls