mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 10:14:30 +00:00
* fix(studio): reconcile external edits before reload * fix(ci): retry transient workspace installs Make external reload retry behavior honest and isolate reload listeners. Remove the dead SDK timestamp parameter.
24 lines
863 B
TypeScript
24 lines
863 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
import { StudioFileConflictError } from "../utils/studioSaveDiagnostics";
|
|
import { drainStudioSaveQueues } from "./usePreviewPersistence";
|
|
|
|
describe("drainStudioSaveQueues", () => {
|
|
it("does not erase a pending-field conflict with a clean DOM queue", async () => {
|
|
const conflict = new StudioFileConflictError({
|
|
filePath: "index.html",
|
|
currentVersion: "v2",
|
|
currentContent: "external",
|
|
attemptedContent: "studio",
|
|
});
|
|
const waitForDomQueue = vi.fn(async () => ({ status: "clean" as const }));
|
|
|
|
await expect(
|
|
drainStudioSaveQueues(
|
|
async () => ({ status: "conflict" as const, error: conflict }),
|
|
waitForDomQueue,
|
|
),
|
|
).resolves.toEqual({ status: "conflict", error: conflict });
|
|
expect(waitForDomQueue).not.toHaveBeenCalled();
|
|
});
|
|
});
|