(overrides: Record<string, unknown> = {})
| 24 | } |
| 25 | |
| 26 | function createTextNode(overrides: Record<string, unknown> = {}): TextNode { |
| 27 | return { |
| 28 | id: 'text-node', |
| 29 | type: 'TEXT', |
| 30 | visible: true, |
| 31 | characters: 'Hello world', |
| 32 | boundVariables: { |
| 33 | width: { id: 'size-card' }, |
| 34 | height: { id: 'size-tall' } |
| 35 | }, |
| 36 | fills: [ |
| 37 | { |
| 38 | type: 'SOLID', |
| 39 | visible: true, |
| 40 | color: { r: 1, g: 0, b: 0 }, |
| 41 | opacity: 1, |
| 42 | boundVariables: { color: { id: 'color-brand' } } |
| 43 | } |
| 44 | ], |
| 45 | getRangeBoundVariable: vi.fn((_start: number, _end: number, field: VariableBindableTextField) => |
| 46 | field === 'fontFamily' ? { id: 'font-body' } : figma.mixed |
| 47 | ), |
| 48 | ...overrides |
| 49 | } as unknown as TextNode |
| 50 | } |
| 51 | |
| 52 | function setupFigma({ |
| 53 | variableById = {}, |
no outgoing calls
no test coverage detected