42 lines · 1001 B · TypeScript
RawDownload
import { describe, expect, it } from "vite-plus/test"; import { resolveThreadSyncPhase } from "./threadSync"; describe("resolveThreadSyncPhase", () => {  it("loads when only shell data is available", () => {    expect(      resolveThreadSyncPhase({        detailExists: false,        shellExists: true,        status: "synchronizing",      }),    ).toBe("loading");  });   it("syncs when cached detail is already visible", () => {    expect(      resolveThreadSyncPhase({        detailExists: true,        shellExists: true,        status: "cached",      }),    ).toBe("syncing");  });   it("does not report a sync phase without a shell or after going live", () => {    expect(      resolveThreadSyncPhase({        detailExists: false,        shellExists: false,        status: "empty",      }),    ).toBeNull();    expect(      resolveThreadSyncPhase({        detailExists: true,        shellExists: true,        status: "live",      }),    ).toBeNull();  });});

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