import React from "react";
import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
const touchState = vi.hoisted(() => ({ enabled: true }));
vi.mock("@/hooks/use-compact-task-chrome", () => ({
useTouchDrawer: () => touchState.enabled,
}));
vi.mock("@/hooks/use-responsive-breakpoint", () => ({
useResponsiveBreakpoint: () => ({ isFinePointer: false }),
}));
vi.mock("react-i18next", () => ({
useTranslation: () => ({ t: (key: string) => (key === "common:open" ? "Open" : key) }),
}));
vi.mock("@tabler/icons-react", () => ({
IconListCheck: () => ,
IconFile: () => ,
IconMessageDots: () => ,
IconPhoto: () => ,
IconAt: () => ,
IconGitPullRequest: () => ,
IconRoute: () => ,
IconX: () => ,
IconPinFilled: () => ,
}));
vi.mock("@kandev/ui/drawer", () => {
const DrawerContext = React.createContext({
open: false,
onOpenChange: (_value: boolean) => {},
});
return {
Drawer: ({
open,
onOpenChange,
children,
}: {
open: boolean;
onOpenChange: (value: boolean) => void;
children: React.ReactNode;
}) => (
{children}
, }; }); import { ContextChip } from "./context-chip"; describe("ContextChip coarse-pointer actions", () => { it("opens the preview drawer and exposes the open action", () => { const onClick = vi.fn(); render(