mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
Revert "feat: Persist Studio manual edits via manifest (#593)"
This reverts commit d0abe90a82.
This commit is contained in:
@@ -1,34 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveFloatingPanelPosition } from "./floatingPanel";
|
||||
|
||||
describe("resolveFloatingPanelPosition", () => {
|
||||
it("places the panel below the anchor when there is space", () => {
|
||||
expect(
|
||||
resolveFloatingPanelPosition(
|
||||
{ left: 100, top: 100, right: 220, bottom: 140, width: 120, height: 40 },
|
||||
{ width: 800, height: 600 },
|
||||
{ width: 280, height: 220 },
|
||||
),
|
||||
).toMatchObject({ top: 148, placement: "bottom" });
|
||||
});
|
||||
|
||||
it("places the panel above the anchor when the bottom would be clipped", () => {
|
||||
expect(
|
||||
resolveFloatingPanelPosition(
|
||||
{ left: 100, top: 500, right: 220, bottom: 540, width: 120, height: 40 },
|
||||
{ width: 800, height: 600 },
|
||||
{ width: 280, height: 220 },
|
||||
),
|
||||
).toMatchObject({ top: 272, placement: "top" });
|
||||
});
|
||||
|
||||
it("clamps the panel horizontally inside the viewport", () => {
|
||||
expect(
|
||||
resolveFloatingPanelPosition(
|
||||
{ left: 760, top: 100, right: 800, bottom: 140, width: 40, height: 40 },
|
||||
{ width: 800, height: 600 },
|
||||
{ width: 280, height: 220 },
|
||||
).left,
|
||||
).toBe(508);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user