import { describe, expect, it } from 'vitest' import { QueryResultChart, xKeyFor } from './QueryResultChart' import { customRender } from '@/tests/lib/custom-render' const CUSTOMER_COLUMN = 'customer_email_address' const chart = { type: 'bar' as const, x_column: 'day', y_series: [CUSTOMER_COLUMN], cumulative: false, show_labels: true, scale: 'linear' as const, } const result = { rows: [ { day: '2026-01-01', [CUSTOMER_COLUMN]: 4 }, { day: '2026-01-02', [CUSTOMER_COLUMN]: 7 }, ], } const styleTextOf = (container: HTMLElement) => Array.from(container.querySelectorAll('style')) .map((style) => style.textContent ?? '') .join('\n') /** * `ChartContainer` writes every config key into a `