Files
t3code/apps/web/src/threadSync.test.ts
T
t3-code[bot] 2daff8c25a test(web): remove tests for unreachable helpers (#8738)
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
2026-08-30 05:31:02 +00:00

43 lines
1001 B
TypeScript

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();
});
});