mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
Revert "feat: Persist Studio manual edits via manifest (#593)"
This reverts commit d0abe90a82.
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { buildEditHistoryEntry, createEmptyEditHistory, pushEditHistoryEntry } from "./editHistory";
|
||||
import {
|
||||
createMemoryEditHistoryStorage,
|
||||
loadEditHistoryState,
|
||||
saveEditHistoryState,
|
||||
} from "./editHistoryStorage";
|
||||
|
||||
describe("edit history storage", () => {
|
||||
let storage: ReturnType<typeof createMemoryEditHistoryStorage>;
|
||||
|
||||
beforeEach(() => {
|
||||
storage = createMemoryEditHistoryStorage();
|
||||
});
|
||||
|
||||
it("returns empty history for projects without persisted state", async () => {
|
||||
const state = await loadEditHistoryState(storage, "project-1");
|
||||
|
||||
expect(state).toEqual(createEmptyEditHistory());
|
||||
});
|
||||
|
||||
it("saves and loads history per project", async () => {
|
||||
const entry = buildEditHistoryEntry({
|
||||
id: "entry-1",
|
||||
projectId: "project-1",
|
||||
label: "Move layer",
|
||||
files: { "index.html": { before: "a", after: "b" } },
|
||||
now: 100,
|
||||
});
|
||||
const state = pushEditHistoryEntry(createEmptyEditHistory(), entry);
|
||||
|
||||
await saveEditHistoryState(storage, "project-1", state);
|
||||
|
||||
expect(await loadEditHistoryState(storage, "project-1")).toEqual(state);
|
||||
expect(await loadEditHistoryState(storage, "project-2")).toEqual(createEmptyEditHistory());
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user