23 lines
722 B
TypeScript
23 lines
722 B
TypeScript
// @vitest-environment jsdom
|
|
import "@testing-library/jest-dom/vitest";
|
|
import { render } from "@testing-library/react";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
import { ContextMenu } from ".";
|
|
|
|
describe("ContextMenu motion", () => {
|
|
it("applies the global open and close animation contract", () => {
|
|
const { container } = render(<ContextMenu>Menu content</ContextMenu>);
|
|
const menu = container.firstElementChild;
|
|
|
|
expect(menu).toHaveClass(
|
|
"data-[state=open]:animate-in",
|
|
"data-[state=closed]:animate-out",
|
|
"data-[state=open]:zoom-in-[0.96]",
|
|
"data-[state=closed]:zoom-out-[0.98]",
|
|
"data-[state=open]:duration-200",
|
|
"motion-reduce:animate-none",
|
|
);
|
|
});
|
|
});
|