diff --git a/src/plugins/d3/renderer/validation/__tests__/validation.test.ts b/src/plugins/d3/renderer/validation/__tests__/validation.test.ts index d5a15657..1db9c2b2 100644 --- a/src/plugins/d3/renderer/validation/__tests__/validation.test.ts +++ b/src/plugins/d3/renderer/validation/__tests__/validation.test.ts @@ -35,7 +35,6 @@ describe('plugins/d3/validation', () => { }); test.each([ - PIE_SERIES.INVALID_VALUE, XY_SERIES.INVALID_CATEGORY_X, XY_SERIES.INVALID_CATEGORY_Y, XY_SERIES.INVALID_DATETIME_X, @@ -52,7 +51,22 @@ describe('plugins/d3/validation', () => { } catch (e) { error = e as ChartKitError; } - // console.log(error?.message); + + expect(error?.code).toEqual(CHARTKIT_ERROR_CODE.INVALID_DATA); + }, + ); + + test.each([PIE_SERIES.INVALID_VALUE])( + '[Pie Series] validateData should throw an error in case of invalid data (data: %j)', + (data) => { + let error: ChartKitError | null = null; + + try { + validateData(data); + } catch (e) { + error = e as ChartKitError; + } + expect(error?.code).toEqual(CHARTKIT_ERROR_CODE.INVALID_DATA); }, ); diff --git a/src/plugins/d3/renderer/validation/index.ts b/src/plugins/d3/renderer/validation/index.ts index 89a5a7ea..1fef611f 100644 --- a/src/plugins/d3/renderer/validation/index.ts +++ b/src/plugins/d3/renderer/validation/index.ts @@ -17,6 +17,7 @@ import {DEFAULT_AXIS_TYPE} from '../constants'; type XYSeries = ScatterSeries | BarXSeries | BarYSeries | LineSeries; const AVAILABLE_SERIES_TYPES: ChartKitWidgetSeries['type'][] = [ + 'area', 'bar-x', 'bar-y', 'line',