Files
OpenXD/src/App.test.tsx
MeghdadFadaee 1d174697fb
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 4m50s
Deploy to GitHub Pages / deploy (push) Has been skipped
Fixed desktop text selection behavior.
2026-06-15 19:43:08 +03:30

22 lines
671 B
TypeScript

import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import App from "./App";
vi.stubGlobal("Worker", class {
postMessage() {}
terminate() {}
});
describe("App canvas selection", () => {
it("does not expose a viewer canvas before a file is opened", () => {
render(<App />);
expect(screen.getByText("Open an Adobe XD file")).toBeInTheDocument();
});
it("keeps normal document text non-selectable by CSS", () => {
const { container } = render(<App />);
fireEvent.doubleClick(container);
expect(container.querySelector(".selectable-text")).not.toBeInTheDocument();
});
});