import { describe, expect, it } from 'vitest' import { CHART_COLORS, barChart, columnChart, lineChart, proportionalPercent, stackedColumnChart, valueList, } from '../../scripts/lib/chartPrimitives.mjs' // C191: the chart primitives were extracted from dossieRender.mjs so the // Instagram generator (second consumer) never grows a twin. These snapshots // freeze the dossier emission byte-for-byte — a change here is a change to the // published dossiê, not a cosmetic tweak. describe('chartPrimitives — dossier emitters (byte-identical)', () => { it('barChart', () => { expect( barChart({ rows: [ { label: 'A', count: 3 }, { label: 'B', count: 1 }, ], }), ).toMatchInlineSnapshot(` "" `) }) it('columnChart', () => { expect( columnChart({ rows: [ { key: '2020', value: 2 }, { key: '2021', value: 4 }, ], format: (row: { value: number }) => String(row.value), }), ).toMatchInlineSnapshot(` "" `) }) it('stackedColumnChart', () => { expect( stackedColumnChart({ rows: [ { key: '2020', value: 3, segments: [ { key: 'pago', amount: 2 }, { key: 'empenhado', amount: 1 }, ], }, ], format: (row: { value: number }) => String(row.value), }), ).toMatchInlineSnapshot(` "" `) }) it('valueList', () => { expect( valueList({ rows: [ { label: 'A', value: 2 }, { label: 'B', value: 1 }, ], format: (row: { value: number }) => String(row.value), }), ).toMatchInlineSnapshot(` "