diff --git a/config/quality/eslint-suppressions.json b/config/quality/eslint-suppressions.json index 6950c395cf..d966760de8 100644 --- a/config/quality/eslint-suppressions.json +++ b/config/quality/eslint-suppressions.json @@ -1056,11 +1056,6 @@ "count": 1 } }, - "src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx": { - "@typescript-eslint/no-unused-vars": { - "count": 1 - } - }, "src/app/api/assess/route.ts": { "@typescript-eslint/no-unused-vars": { "count": 1 diff --git a/config/quality/vitest-exclusions.json b/config/quality/vitest-exclusions.json index db157663f1..0e2c033398 100644 --- a/config/quality/vitest-exclusions.json +++ b/config/quality/vitest-exclusions.json @@ -8,12 +8,6 @@ "measured": "2026-09-10", "status": "Tests 1 failed | 5 passed (6)" }, - { - "file": "src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx", - "issue": "#13204", - "measured": "2026-09-10", - "status": "Tests 1 failed | 6 passed (7)" - }, { "file": "tests/unit/ui/logs-page-detail-modal-reopen-on-close.test.tsx", "issue": "#13204", diff --git a/src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx b/src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx index 09ff7c9ea0..5fd7e81bb9 100644 --- a/src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx +++ b/src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx @@ -67,13 +67,18 @@ function t(key: string): string { function getButton(text: string): HTMLButtonElement | null { return ( (Array.from(document.querySelectorAll("button")).find((b) => b.textContent?.includes(text)) as - | HTMLButtonElement - | undefined) ?? null + HTMLButtonElement | undefined) ?? null ); } const roots: Array<{ unmount: () => void }> = []; +beforeEach(() => { + ( + globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean } + ).IS_REACT_ACT_ENVIRONMENT = true; +}); + afterEach(() => { roots.forEach((r) => { act(() => r.unmount()); @@ -233,6 +238,11 @@ describe("AddWebhookWizard — step 2→3 creates webhook with correct kind", () renderIntoBody(); + // Let the wizard's open/reset effect settle before interacting with step 1. + await act(async () => { + await Promise.resolve(); + }); + // Step 1: default is "slack", click Next const nextBtn1 = getButton("Next"); expect(nextBtn1).toBeTruthy(); diff --git a/vitest.config.ts b/vitest.config.ts index c125f3ea39..ca9c893a24 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -39,7 +39,6 @@ export default defineConfig({ "tests/e2e/protocol-clients.test.ts", // ── Pre-existing failures tracked by #8618 ─────────────────────────────── "tests/unit/ui/request-logger-autorefresh-visibility-3972.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado - "src/app/(dashboard)/dashboard/webhooks/__tests__/webhook-wizard.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado "tests/unit/ui/logs-page-detail-modal-reopen-on-close.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado "tests/unit/ui/agent-card.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado "src/app/(dashboard)/dashboard/endpoint/__tests__/ApiEndpointsTab.test.tsx", // #13204 — falha real; remover esta exclusão quando consertado