13 lines
831 B
TypeScript
13 lines
831 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { textLayerRenderAsset } from "./text-asset";
|
|
|
|
describe("text render data", () => {
|
|
test("creates an owned SVG texture with matching deterministic dimensions", () => {
|
|
const asset = textLayerRenderAsset({ id: "text", type: "text", name: "Text", visible: true, locked: false, opacity: 1, transform: { position: { x: 0, y: 0 }, scale: { x: 1, y: 1 }, rotation: 0 }, content: "A&B", style: { fontFamily: "Georgia", fontSize: 10, fontWeight: 700, fontStyle: "italic", color: "#abcdef", alignment: "center", lineHeight: 1.2 } });
|
|
expect(asset.mimeType).toBe("image/svg+xml");
|
|
expect(asset.source).toStartWith("data:image/svg+xml,");
|
|
expect(decodeURIComponent(asset.source)).toContain("A&B");
|
|
expect(asset.intrinsicSize.w).toBeGreaterThan(0);
|
|
});
|
|
});
|