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 { describe, expect, it } from "vitest";
|
||||||
import { DEFAULT_CHART_CONFIG } from './chatConfig.defaults';
|
import { ChartConfigPropsSchema } from "./chartConfigProps";
|
||||||
import { BusterChartConfigPropsSchema } from './chartConfigProps';
|
import { DEFAULT_CHART_THEME } from "./configColors";
|
||||||
import { DEFAULT_CHART_THEME } from './configColors';
|
|
||||||
|
|
||||||
describe('DEFAULT_CHART_CONFIG', () => {
|
describe("DEFAULT_CHART_CONFIG", () => {
|
||||||
it('should conform to BusterChartConfigPropsSchema and have expected default values', () => {
|
it("should conform to BusterChartConfigPropsSchema and have expected default values", () => {
|
||||||
// Verify that DEFAULT_CHART_CONFIG is valid according to the schema
|
// 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);
|
expect(parseResult.success).toBe(true);
|
||||||
|
|
||||||
if (parseResult.success) {
|
if (parseResult.success) {
|
||||||
|
@ -22,9 +21,9 @@ describe('DEFAULT_CHART_CONFIG', () => {
|
||||||
expect(config.columnSettings).toEqual({});
|
expect(config.columnSettings).toEqual({});
|
||||||
expect(config.columnLabelFormats).toEqual({});
|
expect(config.columnLabelFormats).toEqual({});
|
||||||
expect(config.showLegend).toBeNull();
|
expect(config.showLegend).toBeNull();
|
||||||
expect(config.barLayout).toBe('vertical');
|
expect(config.barLayout).toBe("vertical");
|
||||||
expect(config.barSortBy).toEqual([]);
|
expect(config.barSortBy).toEqual([]);
|
||||||
expect(config.barGroupType).toBe('group');
|
expect(config.barGroupType).toBe("group");
|
||||||
expect(config.barShowTotalAtTop).toBe(false);
|
expect(config.barShowTotalAtTop).toBe(false);
|
||||||
expect(config.lineGroupType).toBeNull();
|
expect(config.lineGroupType).toBeNull();
|
||||||
expect(config.scatterAxis).toEqual({
|
expect(config.scatterAxis).toEqual({
|
||||||
|
@ -32,16 +31,16 @@ describe('DEFAULT_CHART_CONFIG', () => {
|
||||||
y: [],
|
y: [],
|
||||||
category: [],
|
category: [],
|
||||||
size: [],
|
size: [],
|
||||||
tooltip: null
|
tooltip: null,
|
||||||
});
|
});
|
||||||
expect(config.pieChartAxis).toEqual({
|
expect(config.pieChartAxis).toEqual({
|
||||||
x: [],
|
x: [],
|
||||||
y: [],
|
y: [],
|
||||||
tooltip: null
|
tooltip: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Verify the config is a complete object with all required properties
|
// 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();
|
expect(config).not.toBeNull();
|
||||||
|
|
||||||
// Verify it has a selectedChartType (required field)
|
// Verify it has a selectedChartType (required field)
|
||||||
|
|
Loading…
Reference in New Issue