openpencil/tests/engine/figma/api/absolute-position.test.ts
Danila Poyarkov 9ebc61d78f test(figma): split API coverage
- Move FigmaAPI tests into focused files by feature area
- Share API construction from figma/api/helpers.ts
- Remove FigmaAPI coverage from max-lines exceptions
2026-05-06 13:37:15 +03:00

23 lines
603 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { createAPI } from './helpers'
describe('absolute position', () => {
test('absoluteBoundingBox accounts for nesting', () => {
const api = createAPI()
const parent = api.createFrame()
parent.x = 100
parent.y = 200
const child = api.createRectangle()
parent.appendChild(child)
child.x = 10
child.y = 20
child.resize(50, 30)
const bounds = child.absoluteBoundingBox
expect(bounds.x).toBe(110)
expect(bounds.y).toBe(220)
expect(bounds.width).toBe(50)
expect(bounds.height).toBe(30)
})
})