test: playkit v0.3.1 adoption, Zod widening, PROD smoke, NextAuth write gates #68

Merged
ilia merged 8 commits from feat/admin-manage-users-e2e into dev 2026-07-14 22:24:07 -05:00
2 changed files with 19 additions and 0 deletions
Showing only changes of commit 317a135daa - Show all commits
+10
View File
@@ -113,4 +113,14 @@ export class ManageUsersPanel extends BasePage {
async waitForRowGone(email: string, timeout = 15_000): Promise<void> {
await waitForHidden(this.row(email), { timeout });
}
/** The table defaults to the "Active only" filter and refetches with it on
* every save (`ManageUsersContent.handleEditUser` → `fetchUsers()`), so a
* just-deactivated row silently drops out of view. Switch to "All" before
* reading a status badge you expect to still be visible post-deactivation. */
async showAllUsers(): Promise<void> {
await this.click(this.page.locator('#status-filter'));
await this.click(this.page.getByRole('option', { name: 'All', exact: true }));
await waitForHidden(this.page.getByRole('option', { name: 'All', exact: true }));
}
}
@@ -95,6 +95,10 @@ test.describe('admin manage users: causal cross-session effect @smoke', () => {
timings,
}) => {
test.skip(!e2eCredentials, 'E2E_ADMIN_EMAIL/PASSWORD required (admin user)');
// Two full UI logins + create/edit/verify against a shared-CI DEV LXC push
// this past the default 60s under load (observed: a single login step
// alone took ~90s during a concurrent CI burst) — give it more headroom.
test.setTimeout(120_000);
const email = throwawayEmail('deactivate');
let userContext: import('@playwright/test').BrowserContext | undefined;
@@ -135,6 +139,11 @@ test.describe('admin manage users: causal cross-session effect @smoke', () => {
await manageUsersPanel.setActive(false);
await manageUsersPanel.saveEdit();
});
// The table defaults to (and refetches with) the "Active only" filter,
// so the just-deactivated row drops out of view immediately — switch to
// "All" before reading its badge, or this hangs forever waiting for a
// row that the current filter will never show again.
await manageUsersPanel.showAllUsers();
expect(await manageUsersPanel.statusBadgeText(email)).toMatch(/inactive/i);
await accountMenu.closeManageUsers();