diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index 92dbb7ecc1..e6e2ba7a1e 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to the **Prowler UI** are documented in this file. - Allows tenant owners to expel users from their organizations [(#10787)](https://github.com/prowler-cloud/prowler/pull/10787) - Shared filter dropdowns now support local option search and auto-scroll to the first visible match across table and provider filters [(#10859)](https://github.com/prowler-cloud/prowler/pull/10859) - Backward-compatibility middleware redirect from `/sign-up?invitation_token=…` to `/invitation/accept?invitation_token=…`; new invitation emails use `/invitation/accept` directly [(#10797)](https://github.com/prowler-cloud/prowler/pull/10797) +- Mutelist improvements: table now supports name/reason search and visual count badges for finding targets [(#10846)](https://github.com/prowler-cloud/prowler/pull/10846) --- diff --git a/ui/app/(prowler)/mutelist/_components/simple/mute-rule-edit-form.test.tsx b/ui/app/(prowler)/mutelist/_components/simple/mute-rule-edit-form.test.tsx new file mode 100644 index 0000000000..70b90187b6 --- /dev/null +++ b/ui/app/(prowler)/mutelist/_components/simple/mute-rule-edit-form.test.tsx @@ -0,0 +1,132 @@ +import { fireEvent, render, screen, waitFor } from "@testing-library/react"; +import userEvent from "@testing-library/user-event"; +import { describe, expect, it, vi } from "vitest"; + +const { updateMuteRuleMock, toastMock } = vi.hoisted(() => ({ + updateMuteRuleMock: vi.fn(), + toastMock: vi.fn(), +})); + +vi.mock("@/actions/mute-rules", () => ({ + updateMuteRule: updateMuteRuleMock, +})); + +vi.mock("@/components/ui", () => ({ + useToast: () => ({ + toast: toastMock, + }), +})); + +vi.mock("@/components/ui/form", () => ({ + FormButtons: ({ + onCancel, + submitText = "Save", + isDisabled, + }: { + onCancel?: () => void; + submitText?: string; + isDisabled?: boolean; + }) => ( +
+ + +
+ ), +})); + +vi.mock("@/components/shadcn", () => ({ + Input: ({ + defaultValue, + ...props + }: React.InputHTMLAttributes) => ( + + ), + Textarea: ({ + value, + ...props + }: React.TextareaHTMLAttributes) => ( +