mirror of https://github.com/buster-so/buster.git
Update chatConfig.defaults.test.ts
This commit is contained in:
parent
0d114ee850
commit
c99f95c542
|
@ -1,12 +1,11 @@
|
|||
import { describe, it, expect } from 'vitest';
|
||||
import { DEFAULT_CHART_CONFIG } from './chatConfig.defaults';
|
||||
import { BusterChartConfigPropsSchema } from './chartConfigProps';
|
||||
import { DEFAULT_CHART_THEME } from './configColors';
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ChartConfigPropsSchema } from "./chartConfigProps";
|
||||
import { DEFAULT_CHART_THEME } from "./configColors";
|
||||
|
||||
describe('DEFAULT_CHART_CONFIG', () => {
|
||||
it('should conform to BusterChartConfigPropsSchema and have expected default values', () => {
|
||||
describe("DEFAULT_CHART_CONFIG", () => {
|
||||
it("should conform to BusterChartConfigPropsSchema and have expected default values", () => {
|
||||
// Verify that DEFAULT_CHART_CONFIG is valid according to the schema
|
||||
const parseResult = BusterChartConfigPropsSchema.safeParse(DEFAULT_CHART_CONFIG);
|
||||
const parseResult = ChartConfigPropsSchema.safeParse({});
|
||||
expect(parseResult.success).toBe(true);
|
||||
|
||||
if (parseResult.success) {
|
||||
|
@ -22,9 +21,9 @@ describe('DEFAULT_CHART_CONFIG', () => {
|
|||
expect(config.columnSettings).toEqual({});
|
||||
expect(config.columnLabelFormats).toEqual({});
|
||||
expect(config.showLegend).toBeNull();
|
||||
expect(config.barLayout).toBe('vertical');
|
||||
expect(config.barLayout).toBe("vertical");
|
||||
expect(config.barSortBy).toEqual([]);
|
||||
expect(config.barGroupType).toBe('group');
|
||||
expect(config.barGroupType).toBe("group");
|
||||
expect(config.barShowTotalAtTop).toBe(false);
|
||||
expect(config.lineGroupType).toBeNull();
|
||||
expect(config.scatterAxis).toEqual({
|
||||
|
@ -32,16 +31,16 @@ describe('DEFAULT_CHART_CONFIG', () => {
|
|||
y: [],
|
||||
category: [],
|
||||
size: [],
|
||||
tooltip: null
|
||||
tooltip: null,
|
||||
});
|
||||
expect(config.pieChartAxis).toEqual({
|
||||
x: [],
|
||||
y: [],
|
||||
tooltip: null
|
||||
tooltip: null,
|
||||
});
|
||||
|
||||
// Verify the config is a complete object with all required properties
|
||||
expect(typeof config).toBe('object');
|
||||
expect(typeof config).toBe("object");
|
||||
expect(config).not.toBeNull();
|
||||
|
||||
// Verify it has a selectedChartType (required field)
|
||||
|
|
Loading…
Reference in New Issue