import { describe, it, expect } from 'vitest'; import { builtinListStyles, effectiveListLevel, listStyleMarginCm, listStyleOverridden, MAX_LIST_LEVELS, type ListStyle, } from '../../src/lib/styles/listStyles'; const style: ListStyle = { name: 'Test', levels: [ { kind: 'number', numType: 'upper-roman-paren', markerAlign: 'right', indentCm: 0.5 }, { kind: 'bullet', bulletChar: '✓' }, { kind: 'number', numType: 'lower-alpha', startAt: 3 }, ], }; describe('effectiveListLevel (attr ?? style level ?? cycle default)', () => { it('takes the style level where the node has no attr', () => { const eff = effectiveListLevel({}, true, style, 1); expect(eff.listStyleType).toBe('upper-roman-paren'); expect(eff.markerAlign).toBe('right'); expect(eff.indent).toBe(0.5); }); it('lets a node attr override its level', () => { const eff = effectiveListLevel({ listStyleType: 'decimal', indent: 1 }, true, style, 1); expect(eff.listStyleType).toBe('decimal'); expect(eff.indent).toBe(1); expect(eff.markerAlign).toBe('right'); // untouched channel still comes from the style }); it('the level kind wins over the node species (a number level numbers a