mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-06 23:08:16 +00:00
address greptile review feedback (greploop iteration 3)
- Remove Ant Design CSS class selector coupling in ExportFormatSelector test - Lift mock fns out of TestTable component body to enable callback assertions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,9 +22,17 @@ const mockAgent: AgentHubData = {
|
||||
is_public: true,
|
||||
};
|
||||
|
||||
function TestTable({ data, publicPage = false }: { data: AgentHubData[]; publicPage?: boolean }) {
|
||||
const showModal = vi.fn();
|
||||
const copyToClipboard = vi.fn();
|
||||
function TestTable({
|
||||
data,
|
||||
publicPage = false,
|
||||
showModal = vi.fn(),
|
||||
copyToClipboard = vi.fn(),
|
||||
}: {
|
||||
data: AgentHubData[];
|
||||
publicPage?: boolean;
|
||||
showModal?: ReturnType<typeof vi.fn>;
|
||||
copyToClipboard?: ReturnType<typeof vi.fn>;
|
||||
}) {
|
||||
const columns = getAgentHubTableColumns(showModal, copyToClipboard, publicPage);
|
||||
const table = useReactTable({ data, columns, getCoreRowModel: getCoreRowModel() });
|
||||
|
||||
|
||||
@@ -27,9 +27,7 @@ describe("ExportFormatSelector", () => {
|
||||
// Open the Ant Design Select dropdown
|
||||
await user.click(screen.getByText("CSV (Excel, Google Sheets)"));
|
||||
// Select JSON option from the dropdown
|
||||
const jsonOption = await screen.findByText("JSON (includes metadata)", {
|
||||
selector: ".ant-select-item-option-content",
|
||||
});
|
||||
const jsonOption = await screen.findByText("JSON (includes metadata)");
|
||||
await user.click(jsonOption);
|
||||
expect(onChange).toHaveBeenCalledWith("json", expect.anything());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user