schema: add legacy frame edge test and refresh snapshots

This commit is contained in:
Ryan Di
2026-03-20 01:11:05 +11:00
parent 6d3eb16531
commit 21d26b1afe
2 changed files with 15 additions and 1 deletions
+15
View File
@@ -39,6 +39,21 @@ describe("schema migration", () => {
expect((migrated[0] as any).backgroundEnabled).toBeUndefined();
});
it("should normalize legacy false-flag frame backgrounds", () => {
const frame = API.createElement({
type: "frame",
backgroundColor: "#a5d8ff",
});
(frame as any).backgroundEnabled = false;
const migrated = migrateElementsBySchema([frame], SCHEMA_VERSIONS.initial)!;
expect(migrated[0].backgroundColor).toBe(
DEFAULT_ELEMENT_PROPS.backgroundColor,
);
expect((migrated[0] as any).backgroundEnabled).toBeUndefined();
});
it("should resolve invalid schema versions using fallback", () => {
expect(resolveSchemaVersion(undefined, SCHEMA_VERSIONS.initial)).toBe(
SCHEMA_VERSIONS.initial,
@@ -5759,7 +5759,6 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
{
"angle": 0,
"backgroundColor": "transparent",
"backgroundEnabled": false,
"boundElements": null,
"customData": undefined,
"fillStyle": "solid",