schema: add legacy frame edge test and refresh snapshots
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user