From 822cfdcc9b1e69c1be9fabcac26558b620a76509 Mon Sep 17 00:00:00 2001 From: michalkop93 Date: Tue, 7 Oct 2014 09:19:33 +0200 Subject: [PATCH] added test for function in config.data_order --- spec/data-spec.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 spec/data-spec.js diff --git a/spec/data-spec.js b/spec/data-spec.js new file mode 100644 index 0000000..e76bc1e --- /dev/null +++ b/spec/data-spec.js @@ -0,0 +1,33 @@ +var describe = window.describe, + expect = window.expect, + it = window.it, + beforeEach = window.beforeEach; + +describe('c3 chart data', function () { + 'use strict'; + + var chart, d3; + + beforeEach(function () { + window.initDom(); + chart = window.c3.generate({ + data: { + columns: [ + ['data1', 30, 200, 100, 400, 150, 250], + ['data2', 50, 20, 10, 40, 15, 25], + ['data3', 150, 120, 110, 140, 115, 125] + ], + order: function () { + return 0; + } + } + }); + d3 = chart.internal.d3; + }); + + describe('function in data.order', function () { + it('should return false in isOrderAsc and isOrderDesc functions', function () { + expect(chart.internal.isOrderAsc() || chart.internal.isOrderDesc()).toBe(false); + }); + }); +});