Skip to content

Commit

Permalink
fix test typing
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdaemon committed Nov 30, 2021
1 parent 0b0bb3e commit fa78361
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Axes Settings', () => {
areTickLabelsVisible: true,
areGridlinesVisible: true,
isAxisTitleVisible: true,
updateColor: jest.fn(),
toggleAxisTitleVisibility: jest.fn(),
toggleTickLabelsVisibility: jest.fn(),
toggleGridlinesVisibility: jest.fn(),
Expand Down Expand Up @@ -130,16 +131,14 @@ describe('Axes Settings', () => {
});

it('reports a new color choice', () => {
const updateColorMock = jest.fn();

const component = shallow(<AxisSettingsPopover {...props} updateColor={updateColorMock} />);
const component = shallow(<AxisSettingsPopover {...props} />);

const newColor = 'new-color';

component.find(EuiColorPicker).prop('onChange')(newColor, {} as EuiColorPickerOutput);

expect(updateColorMock).toHaveBeenCalledTimes(1);
expect(updateColorMock).toHaveBeenCalledWith(props.axis, newColor);
expect(props.updateColor).toHaveBeenCalledTimes(1);
expect(props.updateColor).toHaveBeenCalledWith(props.axis, newColor);
});
});

Expand Down

0 comments on commit fa78361

Please sign in to comment.