My test passes just fine, however I get the following error.
console.error node_modules/chart.js/src/core/core.controller.js:127
Failed to create chart: can't acquire context from the given item
I've looked around and the closest answer I can find is mentioned here: https://github.com/chartjs/Chart.js/issues/3696 but it looks as if the error is an intentional way of failing gracefully without causing tests to fail.
I'm using Jest/Enzyme to write a test that checks which options are being passed to my chart component.
it('xAxis set to false', () => {
const wrapper = mount(<Chart xAxis='false' chart={parentState.chart} />);
const BarChart = wrapper.find('Bar');
console.log(BarChart.props().options);
expect(BarChart.props().options.scales.xAxes[0].display).toEqual(false);
wrapper.unmount();
});