2019-11-15 01:06:13 -05:00
|
|
|
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', () => {
|
2020-12-23 07:10:26 -05:00
|
|
|
const data = [
|
|
|
|
['', 1],
|
|
|
|
['', 2],
|
|
|
|
['', 3],
|
|
|
|
];
|
2019-11-15 01:06:13 -05:00
|
|
|
|
|
|
|
expect(firstAndLastY(data)).toEqual([1, 3]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|