mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
26 lines
673 B
TypeScript
26 lines
673 B
TypeScript
import React from "react";
|
|
import { Excalidraw } from "../../index";
|
|
import { KEYS } from "../../keys";
|
|
import { Keyboard } from "../../tests/helpers/ui";
|
|
import {
|
|
render,
|
|
waitFor,
|
|
getByTestId,
|
|
fireEvent,
|
|
} from "../../tests/test-utils";
|
|
|
|
describe("Test <DropdownMenu/>", () => {
|
|
it("should", async () => {
|
|
const { container } = await render(<Excalidraw />);
|
|
|
|
expect(window.h.state.openMenu).toBe(null);
|
|
|
|
fireEvent.click(getByTestId(container, "main-menu-trigger"));
|
|
expect(window.h.state.openMenu).toBe("canvas");
|
|
|
|
await waitFor(() => {
|
|
Keyboard.keyDown(KEYS.ESCAPE);
|
|
expect(window.h.state.openMenu).toBe(null);
|
|
});
|
|
});
|
|
});
|