openpencil/tests/engine/editor/clipboard/text-outlines.test.ts
Danila Poyarkov 930cf39216 test: organize prefixed test files into folders
- Move top-level engine and e2e prefixed test files under domain folders
- Update fixture path helpers after moving render and pen tests
- Add lint coverage to prevent new top-level prefixed test files
- Refresh testing docs for the new fig and layout paths
2026-05-06 02:13:18 +03:00

22 lines
823 B
TypeScript

import { describe, expect, test } from 'bun:test'
import { fontManager, probeGlyphOutlineCommands } from '@open-pencil/core'
describe('clipboard text outline probe', () => {
test('lazy-loads opentype.js and extracts glyph commands from a loaded font', async () => {
const font = await fontManager.fetchBundledFont('/Inter-Regular.ttf')
expect(font).toBeTruthy()
if (!font) return
fontManager.markLoaded('Inter', 'Regular', font)
const probe = await probeGlyphOutlineCommands('Inter', 'Regular', 'Hello', 16)
expect(probe).toBeTruthy()
expect(probe?.family).toBe('Inter')
expect(probe?.style).toBe('Regular')
expect(probe?.unitsPerEm).toBeGreaterThan(0)
expect(probe?.commandCount).toBeGreaterThan(0)
expect(probe?.firstGlyphCommandSample.length).toBeGreaterThan(0)
})
})