41 lines · 1.0 KB · TypeScript
RawDownload
import { describe, expect, it } from "vitest"; import { shouldApplyTerminalEvent } from "./service"; describe("shouldApplyTerminalEvent", () => {  it("applies terminal events for draft-only threads", () => {    expect(      shouldApplyTerminalEvent({        serverThreadArchivedAt: undefined,        hasDraftThread: true,      }),    ).toBe(true);  });   it("drops terminal events for unknown threads", () => {    expect(      shouldApplyTerminalEvent({        serverThreadArchivedAt: undefined,        hasDraftThread: false,      }),    ).toBe(false);  });   it("drops terminal events for archived server threads even if a draft exists", () => {    expect(      shouldApplyTerminalEvent({        serverThreadArchivedAt: "2026-04-09T00:00:00.000Z",        hasDraftThread: true,      }),    ).toBe(false);  });   it("applies terminal events for active server threads", () => {    expect(      shouldApplyTerminalEvent({        serverThreadArchivedAt: null,        hasDraftThread: false,      }),    ).toBe(true);  });});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t