Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

textPaste.test.ts

12 lines618 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { isPasteAsTextShortcut } from "./textPaste.ts";
4​
5describe("isPasteAsTextShortcut", () => {
6 it("accepts the V key on non-Latin layouts but follows the letter on Latin ones", () => {
7 const chord = { metaKey: false, ctrlKey: true, shiftKey: true, altKey: false };
8 expect(isPasteAsTextShortcut({ ...chord, key: "М", code: "KeyV" }, false)).toBe(true);
9 expect(isPasteAsTextShortcut({ ...chord, key: "k", code: "KeyV" }, false)).toBe(false);
10 expect(isPasteAsTextShortcut({ ...chord, key: "V", code: "Period" }, false)).toBe(true);
11 });
12});