Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Dec 2, 2020
1 parent eaf5918 commit e1258ed
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions x-pack/plugins/lens/public/xy_visualization/visualization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,27 @@ describe('xy_visualization', () => {
const accessorConfig = breakdownConfig!.accessors[0];
expect(typeof accessorConfig !== 'string' && accessorConfig.palette).toEqual(customColors);
});

it('should respect the order of accessors coming from datasource', () => {
const colorAssignment = require('./color_assignment');
const getAccessorColorConfigSpy = jest.spyOn(colorAssignment, 'getAccessorColorConfig');
mockDatasource.publicAPIMock.getTableSpec.mockReturnValue([
{ columnId: 'c' },
{ columnId: 'b' },
]);
callConfigForYConfigs({});
expect(getAccessorColorConfigSpy).toHaveBeenCalledWith(
expect.anything(),
expect.anything(),
{
accessors: ['c', 'b'],
layerId: 'first',
seriesType: 'area',
xAccessor: 'a',
},
expect.anything()
);
});
});
});

Expand Down

0 comments on commit e1258ed

Please sign in to comment.