Implement share and export components

This commit is contained in:
adilallo
2026-04-29 22:27:46 -06:00
parent a31a36c926
commit a37a72c71d
58 changed files with 3153 additions and 117 deletions
+38
View File
@@ -0,0 +1,38 @@
import { describe, it, expect, vi } from "vitest";
import userEvent from "@testing-library/user-event";
import { renderWithProviders as render, screen } from "../../utils/test-utils";
import "@testing-library/jest-dom/vitest";
import ListItem from "../../../app/components/layout/ListItem";
describe("ListItem", () => {
it("renders as a menu item with label and icon", () => {
render(
<div role="menu" aria-label="Test menu">
<ListItem
showDivider
leadingIcon="markdown_copy"
label="Download Markdown"
onClick={vi.fn()}
/>
</div>,
);
expect(screen.getByRole("menuitem", { name: "Download Markdown" })).toBeTruthy();
});
it("invokes onClick when activated", async () => {
const user = userEvent.setup();
const onClick = vi.fn();
render(
<div role="menu" aria-label="Test menu">
<ListItem
showDivider={false}
leadingIcon="csv"
label="Download CSV"
onClick={onClick}
/>
</div>,
);
await user.click(screen.getByRole("menuitem", { name: "Download CSV" }));
expect(onClick).toHaveBeenCalledTimes(1);
});
});