Skip to content

Commit

Permalink
adjust tests for #597 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos committed Feb 7, 2023
1 parent 2c238d3 commit 1afb88c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions auto_tests/tests/pathological_cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ it('testOnePoint', function() {

it('testCombinations', function() {
var dataSets = {
empty: [],
nil: null,
issue597: [],
empty: [[]],
onePoint: [[10, 2]],
nanPoint: [[10, NaN]],
nanPoints: [[10, NaN], [20, NaN]],
Expand Down Expand Up @@ -111,15 +113,21 @@ it('testCombinations', function() {
box.appendChild(gdiv);
graph.appendChild(box);

var cols = data && data[0] ? data[0].length : 0;
var cols = data && data[0] ? data[0].length : (dataName == 'issue597') ? 1 : 0;
opts.labels = ['X', 'A', 'B', 'C'].slice(0, cols);

var g = new Dygraph(gdiv, data, opts);

if (dataName == 'empty') {
assert.deepEqual(logs, {
log: [], warn: [],
error: ["Can't plot empty data set"]
error: ["Data set cannot contain an empty row"]
});
logs.error = []; // reset
} else if (dataName == 'nil') {
assert.deepEqual(logs, {
log: [], warn: [],
error: ["Unknown data format: null"]
});
logs.error = []; // reset
} else {
Expand Down

0 comments on commit 1afb88c

Please sign in to comment.