forked from cardosofelipe/fast-next-template
Refactor to enforce AuthContext usage over useAuthStore and improve test stability
- Replaced `useAuthStore` with `useAuth` from `AuthContext` across frontend components and tests to ensure dependency injection compliance. - Enhanced E2E test stability by delaying navigation until the auth context is fully initialized. - Updated Playwright configuration to use a single worker to prevent mock conflicts. - Refactored test setup to consistently inject `AuthProvider` for improved isolation and mocking. - Adjusted comments and documentation to clarify dependency injection and testability patterns.
This commit is contained in:
@@ -17,8 +17,8 @@ export default defineConfig({
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI and locally to handle flaky tests */
|
||||
retries: process.env.CI ? 2 : 1,
|
||||
/* Limit workers to prevent test interference and Next dev server overload */
|
||||
workers: process.env.CI ? 1 : 8,
|
||||
/* Use 1 worker to prevent test interference (parallel execution causes auth mock conflicts) */
|
||||
workers: 1,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: process.env.CI ? 'github' : 'list',
|
||||
/* Suppress console output unless VERBOSE=true */
|
||||
|
||||
Reference in New Issue
Block a user