2019-12-26 22:10:19 +05:30
|
|
|
import { firstAndLastY } from '~/lib/utils/chart_utils';
|
|
|
|
|
|
|
|
describe('Chart utils', () => {
|
|
|
|
describe('firstAndLastY', () => {
|
|
|
|
it('returns the first and last y-values of a given data set as an array', () => {
|
2021-03-08 18:12:59 +05:30
|
|
|
const data = [
|
|
|
|
['', 1],
|
|
|
|
['', 2],
|
|
|
|
['', 3],
|
|
|
|
];
|
2019-12-26 22:10:19 +05:30
|
|
|
|
|
|
|
expect(firstAndLastY(data)).toEqual([1, 3]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|