// First figure out first scale id's per axis.
Object.keys(configScales).forEach(id => {
const scaleConf = configScales[id];
+ if (!isObject(scaleConf)) {
+ return console.error(`Invalid scale configuration for scale: ${id}`);
+ }
+ if (scaleConf._proxy) {
+ return console.warn(`Ignoring resolver passed as options for scale: ${id}`);
+ }
const axis = determineAxis(id, scaleConf);
const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);
const defaultScaleOptions = chartDefaults.scales || {};
expect(Chart.defaults.scales.linear._jasmineCheck).not.toBeDefined();
expect(Chart.defaults.scales.category._jasmineCheck).not.toBeDefined();
});
+
+ it('should ignore proxy passed as scale options', function() {
+ let failure = false;
+ const chart = acquireChart({
+ type: 'line',
+ data: [],
+ options: {
+ scales: {
+ x: {
+ grid: {
+ color: ctx => {
+ if (!ctx.tick) {
+ failure = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ });
+ chart.options.scales = {
+ x: chart.options.scales.x,
+ y: {
+ type: 'linear',
+ position: 'right'
+ }
+ };
+ chart.update();
+ expect(failure).toEqual(false);
+ });
+
+ it('should ignore array passed as scale options', function() {
+ const chart = acquireChart({
+ type: 'line',
+ data: [],
+ options: {
+ scales: {
+ xAxes: [{id: 'xAxes', type: 'category'}]
+ }
+ }
+ });
+ expect(chart.scales.xAxes).not.toBeDefined();
+ });
});
describe('Updating options', function() {