Fixed desktop text selection behavior.
This commit is contained in:
21
src/App.test.tsx
Normal file
21
src/App.test.tsx
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user