1import { EnvironmentId, ThreadId } from "@t3tools/contracts";
2import { describe, expect, it } from "vite-plus/test";
3
4import { previewRuntimeTabId } from "./previewRuntimeTabId";
5
6describe("previewRuntimeTabId", () => {
7 it("rejects a pinned operation target after the server epoch changes", () => {
8 const ref = {
9 environmentId: EnvironmentId.make("environment-a"),
10 threadId: ThreadId.make("thread-a"),
11 };
12 const runtimeTabId = previewRuntimeTabId(ref, "epoch-a", "tab_1");
13
14 expect(previewRuntimeTabId(ref, "epoch-a", "tab_1")).toBe(runtimeTabId);
15 expect(previewRuntimeTabId(ref, "epoch-b", "tab_1")).not.toBe(runtimeTabId);
16 });
17});