import { describe, expect, test } from 'bun:test' import { SceneGraph, sceneNodeToJSX, selectionToJSX } from '@open-pencil/core' function makeGraph() { const graph = new SceneGraph() graph.createNode('CANVAS', graph.rootId, { name: 'Page 1' }) return graph } function pageId(graph: SceneGraph) { return graph.getPages()[0].id } function tw(graph: SceneGraph, nodeId: string) { return sceneNodeToJSX(nodeId, graph, 'tailwind') } describe('Tailwind JSX export', () => { test('basic rectangle — div with w/h', () => { const graph = makeGraph() const node = graph.createNode('RECTANGLE', pageId(graph), { name: 'Box', width: 100, height: 48 }) const jsx = tw(graph, node.id) expect(jsx).toContain('
with text classes', () => { const graph = makeGraph() const node = graph.createNode('TEXT', pageId(graph), { name: 'Title', width: 200, height: 24, text: 'Hello World', fontSize: 18, fontWeight: 700, fills: [{ type: 'SOLID', color: { r: 0, g: 0, b: 0, a: 1 }, opacity: 1, visible: true }] }) const jsx = tw(graph, node.id) expect(jsx).toContain('
Hello World
') expect(jsx).not.toContain('