Skip to content

Commit

Permalink
[charts] Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Jan 2, 2024
1 parent e836123 commit d40a77f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/x-charts/src/LineChart/formatter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { expect } from 'chai';
import { FormatterParams } from '@mui/x-charts/models/seriesType/config';
import lineFormatter from '@mui/x-charts/LineChart/formatter';

const seriesOrder = ['id1'];
const seriesDataset: FormatterParams<'line'>['series'] = {
id1: {
// useless info
type: 'line',
id: 'id1',
color: 'red',
// usefull info
dataKey: 'k',
},
};
const seriesData: FormatterParams<'line'>['series'] = {
id1: {
// useless info
type: 'line',
id: 'id1',
color: 'red',
// usefull info
data: [1, 2, 3],
},
};

const dataSet = [{ k: 1 }, { k: 2 }, { k: 3 }];

describe.only('LineChart - formatter', () => {
describe('data from dataset', () => {
it('shoudld get data from the dataset', () => {
const results = lineFormatter({ seriesOrder, series: seriesDataset }, dataSet);
console.log(results);
});
});
});

0 comments on commit d40a77f

Please sign in to comment.