openpencil/tests/engine/figma/api/find/all-with-criteria.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

26 lines
741 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { createAPI } from '../helpers'
describe('findAllWithCriteria', () => {
test('filters by type', () => {
const api = createAPI()
api.createFrame()
api.createRectangle()
api.createText()
api.createRectangle()
const rects = api.currentPage.findAllWithCriteria({ types: ['RECTANGLE'] })
expect(rects.length).toBe(2)
expect(rects.every((n) => n.type === 'RECTANGLE')).toBe(true)
})
test('filters by multiple types', () => {
const api = createAPI()
api.createFrame()
api.createRectangle()
api.createText()
const result = api.currentPage.findAllWithCriteria({ types: ['FRAME', 'TEXT'] })
expect(result.length).toBe(2)
})
})