mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-19 13:23:50 +03:00
test(dashboard): reactivate webhook wizard coverage (#13844)
Co-authored-by: Paco Cartones <pacocartones@users.noreply.github.com>
This commit is contained in:
@@ -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(<AddWebhookWizard isOpen={true} onClose={vi.fn()} onCreated={vi.fn()} t={t} />);
|
||||
|
||||
// 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();
|
||||
|
||||
Reference in New Issue
Block a user