test(engine): stabilize full engine smoke
This commit is contained in:
parent
21b649e540
commit
ab700fd8be
|
|
@ -14,7 +14,7 @@ import { heavy } from '#tests/helpers/test-utils'
|
|||
|
||||
setDefaultTimeout(30_000)
|
||||
|
||||
const FIXTURES = resolve(import.meta.dir, '../fixtures')
|
||||
const FIXTURES = resolve(import.meta.dir, '../../../../fixtures')
|
||||
|
||||
describe('fig export compression', () => {
|
||||
test('compressFigDataSync produces valid zip', async () => {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe('Fix 4: text lineHeight serialization', () => {
|
|||
expect(changes[0].lineHeight).toEqual({ value: 24, units: 'PIXELS' })
|
||||
})
|
||||
|
||||
test('text node without lineHeight defaults to ceil(fontSize * 1.2)', () => {
|
||||
test('text node without lineHeight omits lineHeight', () => {
|
||||
const graph = new SceneGraph()
|
||||
const node = graph.createNode('TEXT', pageId(graph), {
|
||||
name: 'DefaultLH',
|
||||
|
|
@ -38,31 +38,10 @@ describe('Fix 4: text lineHeight serialization', () => {
|
|||
fontFamily: 'Inter',
|
||||
fontWeight: 400,
|
||||
fontSize: 16
|
||||
// lineHeight not set — defaults to null
|
||||
})
|
||||
|
||||
const changes = toKiwi(node, graph) as Record<string, unknown>[]
|
||||
// ceil(16 * 1.2) = ceil(19.2) = 20
|
||||
expect(changes[0].lineHeight).toEqual({ value: 20, units: 'PIXELS' })
|
||||
})
|
||||
|
||||
test('lineHeight default for odd fontSize', () => {
|
||||
const graph = new SceneGraph()
|
||||
const node = graph.createNode('TEXT', pageId(graph), {
|
||||
name: 'OddSize',
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 100,
|
||||
height: 20,
|
||||
text: 'Hello',
|
||||
fontFamily: 'Inter',
|
||||
fontWeight: 400,
|
||||
fontSize: 14
|
||||
})
|
||||
|
||||
const changes = toKiwi(node, graph) as Record<string, unknown>[]
|
||||
// ceil(14 * 1.2) = ceil(16.8) = 17
|
||||
expect(changes[0].lineHeight).toEqual({ value: 17, units: 'PIXELS' })
|
||||
expect(changes[0].lineHeight).toBeUndefined()
|
||||
})
|
||||
|
||||
test('lineHeight survives roundtrip through export/parse', async () => {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ describe('text measurement', () => {
|
|||
// an older layout implementation. Post-layout, left-aligned HUG content retains x=8.
|
||||
expect(visibleToolbar.x).toBe(8)
|
||||
|
||||
setTextMeasurer(null)
|
||||
computeAllLayouts(graph, graph.getPages()[0].id)
|
||||
|
||||
expect(graph.getNode(visibleToolbar.id)?.x).toBe(8)
|
||||
|
|
|
|||
Loading…
Reference in a new issue