Fixed desktop text selection behavior.
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 4m50s
Deploy to GitHub Pages / deploy (push) Has been skipped

This commit is contained in:
2026-06-14 18:55:43 +03:30
parent fc4ef29230
commit 1d174697fb
3 changed files with 45 additions and 2 deletions

21
src/App.test.tsx Normal file
View File

@@ -0,0 +1,21 @@
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();
});
});