mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
test(ui): spread the real lucide-react module in the KeyInfoView mock
The mock returned only CopyIcon and CheckIcon, so any icon a child later imports resolves to undefined. DeleteResourceModal now renders CircleAlert, which broke all twelve cases in this file.
This commit is contained in:
parent
afff1b08fa
commit
d7ec4d98b1
1 changed files with 3 additions and 2 deletions
|
|
@ -182,7 +182,8 @@ vi.mock("@heroicons/react/outline", async () => {
|
|||
return { ArrowLeftIcon, TrashIcon, RefreshIcon };
|
||||
});
|
||||
|
||||
vi.mock("lucide-react", async () => {
|
||||
vi.mock("lucide-react", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("lucide-react")>();
|
||||
const React = await import("react");
|
||||
function CopyIcon() {
|
||||
return React.createElement("span");
|
||||
|
|
@ -192,7 +193,7 @@ vi.mock("lucide-react", async () => {
|
|||
return React.createElement("span");
|
||||
}
|
||||
(CheckIcon as any).displayName = "CheckIcon";
|
||||
return { CopyIcon, CheckIcon };
|
||||
return { ...actual, CopyIcon, CheckIcon };
|
||||
});
|
||||
|
||||
// Heavy children -> async factories & local React
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue