Skip to content
Source
Sign inSign up

compactEditorInsets.test.ts

17 lines623 Bytes

1import { describe, expect, it } from "vite-plus/test";
2​
3import { compactEditorInsets } from "./compactEditorInsets";
4​
5describe("compact editor insets", () => {
6 it("keeps the measured slot position in left-to-right layouts", () => {
7 expect(compactEditorInsets({ slotX: 48, slotWidth: 200, rowWidth: 360, isRTL: false })).toEqual(
8 { left: 52, right: 116 },
9 );
10 });
11​
12 it("swaps the insets in right-to-left layouts so the editor stays over its slot", () => {
13 expect(compactEditorInsets({ slotX: 112, slotWidth: 200, rowWidth: 360, isRTL: true })).toEqual(
14 { left: 52, right: 116 },
15 );
16 });
17});