|
|
@ -186,6 +186,65 @@ describe('c3 chart data', function () { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('addHiddenTargetIds if not already hidden', function () { |
|
|
|
|
|
|
|
it('should update args', function () { |
|
|
|
|
|
|
|
args = { |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
['data1', 30, 200, 100, 400, 150, 250], |
|
|
|
|
|
|
|
['data2', 150, 120, 110, 140, 115, 125] |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
expect(true).toBeTruthy(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('length of hiddenTargetIds should not change if same key added twice', function () { |
|
|
|
|
|
|
|
chart.internal.addHiddenTargetIds('data1'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.internal.addHiddenTargetIds('data1'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.hide('data1'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.internal.addHiddenTargetIds('data2'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(2); |
|
|
|
|
|
|
|
chart.show(); |
|
|
|
|
|
|
|
chart.hide(['data1', 'data2']); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(2); |
|
|
|
|
|
|
|
chart.show(); |
|
|
|
|
|
|
|
chart.hide(); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenTargetIds.length).toBe(2); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('addHiddenLegendIds if not already hidden', function () { |
|
|
|
|
|
|
|
it('should update args', function () { |
|
|
|
|
|
|
|
args = { |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
columns: [ |
|
|
|
|
|
|
|
['data1', 30, 200, 100, 400, 150, 250], |
|
|
|
|
|
|
|
['data2', 150, 120, 110, 140, 115, 125] |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
expect(true).toBeTruthy(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it('length of hiddenLegendIds should not change if same key added twice', function () { |
|
|
|
|
|
|
|
chart.internal.addHiddenLegendIds('data1'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenLegendIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.internal.addHiddenLegendIds('data1'); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenLegendIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.hide('data1', {withLegend: true}); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenLegendIds.length).toBe(1); |
|
|
|
|
|
|
|
chart.hide('data2', {withLegend: true}); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenLegendIds.length).toBe(2); |
|
|
|
|
|
|
|
chart.show(['data1', 'data2'], {withLegend: true}); |
|
|
|
|
|
|
|
chart.hide(['data1', 'data2'], {withLegend: true}); |
|
|
|
|
|
|
|
expect(chart.internal.hiddenLegendIds.length).toBe(2); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
describe('data.xs', function () { |
|
|
|
describe('data.xs', function () { |
|
|
|
|
|
|
|
|
|
|
|
beforeAll(function () { |
|
|
|
beforeAll(function () { |
|
|
|