forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e836123
commit d40a77f
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}); | ||
}); | ||
}); |