1import { describe, expect, it } from "vite-plus/test";
2
3import { parseActiveThreadPath } from "./hardwareKeyboardCommands";
4
5describe("parseActiveThreadPath", () => {
6 it("decodes route components", () => {
7 expect(parseActiveThreadPath("/threads/local%20machine/thread%2Fone/review")).toEqual({
8 environmentId: "local machine",
9 threadId: "thread/one",
10 });
11 });
12
13 it("ignores malformed encoded route components", () => {
14 expect(parseActiveThreadPath("/threads/%E0%A4%A/thread-1")).toBeNull();
15 });
16});