mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
22 lines
539 B
TypeScript
22 lines
539 B
TypeScript
import { parseClipboard } from "./clipboard";
|
|
import { createPasteEvent } from "./tests/test-utils";
|
|
|
|
describe("Test parseClipboard", () => {
|
|
it("should parse valid json correctly", async () => {
|
|
let text = "123";
|
|
|
|
let clipboardData = await parseClipboard(
|
|
createPasteEvent({ "text/plain": text }),
|
|
);
|
|
|
|
expect(clipboardData.text).toBe(text);
|
|
|
|
text = "[123]";
|
|
|
|
clipboardData = await parseClipboard(
|
|
createPasteEvent({ "text/plain": text }),
|
|
);
|
|
|
|
expect(clipboardData.text).toBe(text);
|
|
});
|
|
});
|