- 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
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { describe, expect, test } from 'bun:test'
|
|
|
|
import { importNodeChanges } from '@open-pencil/core'
|
|
|
|
import { canvas, doc, node } from '../helpers'
|
|
|
|
describe('fig-import: clipsContent with resizeToFit', () => {
|
|
test('regular FRAME with frameMaskDisabled=false clips content', () => {
|
|
const graph = importNodeChanges([
|
|
doc(),
|
|
canvas(),
|
|
node('FRAME', 10, 1, { frameMaskDisabled: false })
|
|
])
|
|
const frame = graph.getChildren(graph.getPages()[0].id)[0]
|
|
expect(frame.clipsContent).toBe(true)
|
|
})
|
|
|
|
test('resizeToFit FRAME does not clip even with frameMaskDisabled=false', () => {
|
|
const graph = importNodeChanges([
|
|
doc(),
|
|
canvas(),
|
|
node('FRAME', 10, 1, { frameMaskDisabled: false, resizeToFit: true })
|
|
])
|
|
const frame = graph.getChildren(graph.getPages()[0].id)[0]
|
|
expect(frame.clipsContent).toBe(false)
|
|
})
|
|
|
|
test('FRAME with frameMaskDisabled=true does not clip', () => {
|
|
const graph = importNodeChanges([
|
|
doc(),
|
|
canvas(),
|
|
node('FRAME', 10, 1, { frameMaskDisabled: true })
|
|
])
|
|
const frame = graph.getChildren(graph.getPages()[0].id)[0]
|
|
expect(frame.clipsContent).toBe(false)
|
|
})
|
|
})
|