63650f82d1
Co-authored-by: dwelle <luzar.david@gmail.com>
23 lines
539 B
TypeScript
23 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);
|
|
});
|
|
});
|