openpencil/tests/engine/figma/api/absolute/position.test.ts
Danila Poyarkov aad26b535e test: move prefixed splits into domain folders
- Move newly split tests under explicit domain subfolders
- Update nested helper imports after the moves
- Add a lint guard against repeating existing sibling domains as filename prefixes
2026-05-06 14:27:21 +03:00

23 lines
604 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)
})
})