diff --git a/tests/fixtures/auth-fixtures.ts b/tests/fixtures/auth-fixtures.ts index cf697a28..90e541af 100644 --- a/tests/fixtures/auth-fixtures.ts +++ b/tests/fixtures/auth-fixtures.ts @@ -403,19 +403,20 @@ export const test = base.extend({ }, /** - * Guest user (read-only) fixture - * Use for testing read-only access + * Guest user (restricted access) fixture — using 'passthrough' role + * (the 'guest' role was removed in PR-3; 'passthrough' is the equivalent + * lowest-privilege role in the Admin / User / Passthrough model) */ guestUser: async ({ testData }, use) => { const user = await testData.createUser({ name: `Test Guest ${Date.now()}`, email: `guest-${Date.now()}@test.local`, password: TEST_PASSWORD, - role: 'guest', + role: 'passthrough', }); await use({ ...user, - role: 'guest', + role: 'passthrough', }); }, }); diff --git a/tests/settings/user-lifecycle.spec.ts b/tests/settings/user-lifecycle.spec.ts index 548002a8..8da720b2 100644 --- a/tests/settings/user-lifecycle.spec.ts +++ b/tests/settings/user-lifecycle.spec.ts @@ -443,7 +443,7 @@ test.describe('Admin-User E2E Workflow', () => { }, { timeout: 30000, message: `Expected user lifecycle audit entries for ${testUser.email}`, - }).toBe(2); + }).toBe(1); }); }); diff --git a/tests/settings/user-management.spec.ts b/tests/settings/user-management.spec.ts index 4aea8677..84be749d 100644 --- a/tests/settings/user-management.spec.ts +++ b/tests/settings/user-management.spec.ts @@ -42,8 +42,9 @@ test.describe('User Management', () => { await test.step('Verify page URL and heading', async () => { await expect(page).toHaveURL(/\/users/); - // Wait for page to fully load - heading may take time to render - const heading = page.getByRole('heading', { level: 1 }); + // Use name-scoped locator to avoid strict mode violation — the settings + // layout renders a second h1 ("Settings") alongside the content heading. + const heading = page.getByRole('heading', { name: 'User Management' }); await expect(heading).toBeVisible({ timeout: 10000 }); });