Skip to content

Commit

Permalink
Added test from chartjs#8935 as requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
tinfoilpancakes committed Apr 18, 2021
1 parent f77b619 commit 5c1be67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/specs/core.datasetController.tests.js
Expand Up @@ -699,6 +699,29 @@ describe('Chart.DatasetController', function() {
Chart.defaults.parsing = originalDefault;
});

it('should not fail to produce stacks when parsing is off', function() {
var chart = acquireChart({
type: 'line',
data: {
datasets: [{
data: [{x: 1, y: 10}]
}, {
data: [{x: 1, y: 20}]
}]
},
options: {
parsing: false,
scales: {
x: {stacked: true},
y: {stacked: true}
}
}
});

var meta = chart.getDatasetMeta(0);
expect(meta._parsed[0]._stacks).toEqual(jasmine.objectContaining({y: {0: 10, 1: 20}}));
});

describe('resolveDataElementOptions', function() {
it('should cache options when possible', function() {
const chart = acquireChart({
Expand Down

0 comments on commit 5c1be67

Please sign in to comment.