mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-16 05:17:41 +02:00
37 lines
1013 B
TypeScript
37 lines
1013 B
TypeScript
// @vitest-environment jsdom
|
|
|
|
import { flushSync } from "react-dom";
|
|
import { createRoot } from "react-dom/client";
|
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
import { KeyboardShortcutsCheatsheetContent } from "./KeyboardShortcutsCheatsheet";
|
|
|
|
describe("KeyboardShortcutsCheatsheet", () => {
|
|
let container: HTMLDivElement;
|
|
|
|
beforeEach(() => {
|
|
container = document.createElement("div");
|
|
document.body.appendChild(container);
|
|
});
|
|
|
|
afterEach(() => {
|
|
container.remove();
|
|
document.body.innerHTML = "";
|
|
});
|
|
|
|
it("does not advertise the retired sidebar collapse shortcut", () => {
|
|
const root = createRoot(container);
|
|
flushSync(() => {
|
|
root.render(<KeyboardShortcutsCheatsheetContent />);
|
|
});
|
|
|
|
const row = [...container.querySelectorAll("span")].find(
|
|
(node) => node.textContent?.trim() === "Collapse or expand sidebar",
|
|
)?.parentElement;
|
|
expect(row).toBeUndefined();
|
|
|
|
flushSync(() => {
|
|
root.unmount();
|
|
});
|
|
});
|
|
});
|