Browse Source

Removing bullshit assertions from new mocha tests

v1-dev
Ændrew Rininsland 8 years ago
parent
commit
4f3f5ccd79
No known key found for this signature in database
GPG Key ID: ADBCD4C867F9B2DA
  1. 3
      .eslintrc
  2. 9
      package.json
  3. 2
      spec-mocha/api.axis-spec.js
  4. 2
      spec-mocha/api.focus-spec.js
  5. 2
      spec-mocha/api.grid-spec.js
  6. 4
      spec-mocha/api.load-spec.js
  7. 6
      spec-mocha/api.region-spec.js
  8. 6
      spec-mocha/api.zoom-spec.js
  9. 10
      spec-mocha/arc-spec.js
  10. 50
      spec-mocha/axis-spec.js
  11. 42
      spec-mocha/c3-helper.js
  12. 12
      spec-mocha/c3-spec.js
  13. 14
      spec-mocha/core-spec.js
  14. 78
      spec-mocha/data-spec.js
  15. 14
      spec-mocha/domain-spec.js
  16. 20
      spec-mocha/grid-spec.js
  17. 8
      spec-mocha/interaction-spec.js
  18. 24
      spec-mocha/legend-spec.js
  19. 10
      spec-mocha/shape.bar-spec.js
  20. 14
      spec-mocha/shape.line-spec.js
  21. 2
      spec-mocha/tooltip-spec.js
  22. 14
      spec-mocha/type-spec.js

3
.eslintrc

@ -44,5 +44,8 @@
"max-lines": 0,
"vars-on-top": 0,
"no-unused-vars": 0,
"import/no-extraneous-dependencies": [2, {
devDependencies: true
}],
}
}

9
package.json

@ -5,7 +5,7 @@
"main": "c3.js",
"scripts": {
"lint": "eslint src/",
"test": "karma start karma.conf.js",
"test": "mocha spec-mocha/ --compilers js:babel-register",
"codecov": "cat coverage/*/lcov.info | codecov",
"build": "rollup -cm"
},
@ -28,7 +28,9 @@
"devDependencies": {
"babel-plugin-external-helpers": "^6.8.0",
"babel-preset-es2015": "^6.14.0",
"chai": "^3.5.0",
"chai-color-helpers": "github:aendrew/chai-color-helpers",
"chai-colors": "^1.0.1",
"codecov.io": "^0.1.6",
"eslint": "^3.5.0",
"eslint-config-airbnb-base": "^7.1.0",
@ -42,6 +44,7 @@
"grunt-karma": "^2.0.0",
"grunt-sass": "^1.2.0",
"jasmine-core": "^2.4.1",
"jsdom": "^9.5.0",
"jshint-stylish": "^2.2.0",
"karma": "^1.1.1",
"karma-babel-preprocessor": "^6.0.1",
@ -51,8 +54,10 @@
"karma-rollup-plugin": "^0.2.3",
"karma-spec-reporter": "0.0.26",
"load-grunt-tasks": "^3.5.0",
"mocha": "^3.0.2",
"phantomjs-prebuilt": "^2.1.7",
"rollup": "^0.35.10",
"rollup-plugin-babel": "^2.6.1"
"rollup-plugin-babel": "^2.6.1",
"sinon": "^1.17.6"
}
}

2
spec-mocha/api.axis-spec.js

@ -32,7 +32,7 @@ describe('c3 api axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should update y axis label', function () {

2
spec-mocha/api.focus-spec.js

@ -384,7 +384,7 @@ describe('c3 api focus', function () {
args.legend = {
show: false
};
expect(true).to.be.ok;
});
it('should focus all targets without showing legend', function (done) {

2
spec-mocha/api.grid-spec.js

@ -19,7 +19,7 @@ describe('c3 api grid', function () {
]
}
};
expect(true).to.be.ok;
});
it('should update y grids', function (done) {

4
spec-mocha/api.load-spec.js

@ -22,7 +22,7 @@ describe('c3 api load', function () {
]
}
};
expect(true).to.be.ok;
});
it('should load additional data', function (done) {
@ -64,7 +64,7 @@ describe('c3 api load', function () {
}
}
};
expect(true).to.be.ok;
});
describe('as column', function () {

6
spec-mocha/api.region-spec.js

@ -33,7 +33,7 @@ describe('c3 api region', function () {
}
]
};
expect(true).to.be.ok;
});
it('should update regions', function (done) {
@ -108,7 +108,7 @@ describe('c3 api region', function () {
}
]
};
expect(true).to.be.ok;
});
it('should add regions', function (done) {
@ -205,7 +205,7 @@ describe('c3 api region', function () {
},
]
};
expect(true).to.be.ok;
});
it('should remove regions', function (done) {

6
spec-mocha/api.zoom-spec.js

@ -24,7 +24,7 @@ describe('c3 api zoom', function () {
enabled: true
}
};
expect(true).to.be.ok;
});
it('should be zoomed properly', function () {
@ -61,7 +61,7 @@ describe('c3 api zoom', function () {
enabled: true
}
};
expect(true).to.be.ok;
});
it('should be zoomed properly', function () {
@ -95,7 +95,7 @@ describe('c3 api zoom', function () {
enabled: true
}
};
expect(true).to.be.ok;
});
it('should be unzoomed properly', function () {

10
spec-mocha/arc-spec.js

@ -22,7 +22,7 @@ describe('c3 chart arc', function () {
type: 'pie'
}
};
expect(true).to.be.ok;
});
it('should have correct classes', function () {
@ -55,7 +55,7 @@ describe('c3 chart arc', function () {
['data2', 150],
['data3', 120]
];
expect(true).to.be.ok;
});
it('should have correct d even if data id can be converted to a color', function (done) {
@ -76,7 +76,7 @@ describe('c3 chart arc', function () {
type: 'pie'
}
};
expect(true).to.be.ok;
});
it('should have correct d attribute', function () {
@ -115,7 +115,7 @@ describe('c3 chart arc', function () {
type: 'gauge'
}
};
expect(true).to.be.ok;
});
it('should have correct d for Pi radian gauge', function () {
@ -144,7 +144,7 @@ describe('c3 chart arc', function () {
startingAngle: Math.PI/2
}
};
expect(true).to.be.ok;
});
it('should have correct d for 2 Pi radian gauge starting at Pi/2', function() {

50
spec-mocha/axis-spec.js

@ -37,7 +37,7 @@ describe('c3 chart axis', function () {
it('should update args to have only 1 tick on y axis', function () {
args.axis.y.tick.count = 1;
expect(true).to.be.ok;
});
it('should have only 1 tick on y axis', function () {
@ -47,7 +47,7 @@ describe('c3 chart axis', function () {
it('should update args to have 2 ticks on y axis', function () {
args.axis.y.tick.count = 2;
expect(true).to.be.ok;
});
it('should have 2 ticks on y axis', function () {
@ -57,7 +57,7 @@ describe('c3 chart axis', function () {
it('should update args to have 3 ticks on y axis', function () {
args.axis.y.tick.count = 3;
expect(true).to.be.ok;
});
it('should have 3 ticks on y axis', function () {
@ -73,7 +73,7 @@ describe('c3 chart axis', function () {
it('should update args to have only 2 ticks on y axis', function () {
args.axis.y.tick.values = values;
expect(true).to.be.ok;
});
it('should have only 2 tick on y axis', function () {
@ -109,7 +109,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have 7 ticks on y axis', function () {
@ -133,7 +133,7 @@ describe('c3 chart axis', function () {
value : 'seconds',
interval : 60
};
expect(true).to.be.ok;
});
it('should have 4 ticks on y axis', function () {
@ -204,7 +204,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should construct indexed x axis properly', function () {
@ -232,7 +232,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should split x axis tick text to multiple lines', function () {
@ -295,7 +295,7 @@ describe('c3 chart axis', function () {
['data1', 3000000000000000, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
];
expect(true).to.be.ok;
});
it('should not split y axis tick text to multiple lines', function () {
@ -312,7 +312,7 @@ describe('c3 chart axis', function () {
it('should update args to rotate axis', function () {
args.axis.rotated = true;
expect(true).to.be.ok;
});
it('should split x axis tick text to multiple lines', function () {
@ -385,7 +385,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should locate ticks properly', function () {
@ -433,7 +433,7 @@ describe('c3 chart axis', function () {
it('should update args to rotate axis', function () {
args.axis.rotated = true;
expect(true).to.be.ok;
});
it('should locate ticks on rotated axis properly', function () {
@ -486,7 +486,7 @@ describe('c3 chart axis', function () {
args.axis.x.tick = {
multiline: false
};
expect(true).to.be.ok;
});
it('should split x tick', function () {
@ -503,7 +503,7 @@ describe('c3 chart axis', function () {
args.axis.x.tick = {
width: 150
};
expect(true).to.be.ok;
});
it('should split x tick to 2 lines properly', function () {
@ -537,7 +537,7 @@ describe('c3 chart axis', function () {
args.axis.x.tick.format = function () {
return ['this is a very long tick text', 'on category axis'];
};
expect(true).to.be.ok;
});
it('should have multiline tick text', function () {
@ -577,7 +577,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should rotate tick texts', function () {
@ -622,7 +622,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should rotate tick texts', function () {
@ -658,7 +658,7 @@ describe('c3 chart axis', function () {
]
}
};
expect(true).to.be.ok;
});
it('should show fitted ticks on indexed data', function () {
@ -678,7 +678,7 @@ describe('c3 chart axis', function () {
]
}
};
expect(true).to.be.ok;
});
it('should show fitted ticks on indexed data', function () {
@ -714,7 +714,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should show fitted ticks on indexed data', function () {
@ -732,7 +732,7 @@ describe('c3 chart axis', function () {
['data3', 150, 120, 110, 140, 115, 125]
]
};
expect(true).to.be.ok;
});
it('should show fitted ticks on indexed data', function () {
@ -766,7 +766,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should not have inner y axis', function () {
@ -780,7 +780,7 @@ describe('c3 chart axis', function () {
it('should update args to have inner y axis', function () {
args.axis.y.inner = true;
expect(true).to.be.ok;
});
it('should have inner y axis', function () {
@ -811,7 +811,7 @@ describe('c3 chart axis', function () {
}
}
};
expect(true).to.be.ok;
});
it('should not have inner y axis', function () {
@ -825,7 +825,7 @@ describe('c3 chart axis', function () {
it('should update args to have inner y axis', function () {
args.axis.y2.inner = true;
expect(true).to.be.ok;
});
it('should have inner y axis', function () {

42
spec-mocha/c3-helper.js

@ -1,38 +1,33 @@
function initDom() {
import { jsdom } from 'jsdom';
import * as c3 from '../src/index';
var div = document.createElement('div');
export function initDom() {
var div = jsdom('<div></div>');
div.id = 'chart';
div.style.width = '640px';
div.style.height = '480px';
document.body.appendChild(div);
document.body.style.margin = '0px';
}
typeof initDom !== 'undefined';
function setMouseEvent(chart, name, x, y, element) {
var paddingLeft = chart.internal.main.node().transform.baseVal.getItem(0).matrix.e,
event = document.createEvent("MouseEvents");
event.initMouseEvent(name, true, true, window,
0, 0, 0, x + paddingLeft, y + 5,
false, false, false, false, 0, null);
chart.internal.d3.event = event;
if (element) { element.dispatchEvent(event); }
}
typeof setMouseEvent !== 'undefined';
function initChart(chart, args, done) {
// export function setMouseEvent(chart, name, x, y, element) {
// var paddingLeft = chart.internal.main.node().transform.baseVal.getItem(0).matrix.e,
// event = document.createEvent("MouseEvents");
// event.initMouseEvent(name, true, true, window,
// 0, 0, 0, x + paddingLeft, y + 5,
// false, false, false, false, 0, null);
// chart.internal.d3.event = event;
// if (element) { element.dispatchEvent(event); }
// }
export function initChart(chart, args, done) {
if (typeof chart === 'undefined') {
window.initDom();
initDom();
}
if (args) {
chart = window.c3.generate(args);
window.d3 = chart.internal.d3;
window.d3.select('.jasmine_html-reporter')
chart = c3.generate(args);
global.d3 = chart.internal.d3;
global.d3.select('.jasmine_html-reporter')
.style('position', 'absolute')
.style('width', '640px')
.style('right', 0);
@ -44,4 +39,3 @@ function initChart(chart, args, done) {
return chart;
}
typeof initChart !== 'undefined';

12
spec-mocha/c3-spec.js

@ -1,12 +0,0 @@
var expect = require('chai').expect;
describe('c3', function () {
var c3 = window.c3;
it('exists', function () {
expect(c3).not.to.be.null;
expect(typeof c3).to.equal('object');
});
});

14
spec-mocha/core-spec.js

@ -31,7 +31,7 @@ describe('c3 chart', function () {
it('should set 3rd party property to Function', function () {
Function.prototype.$extIsFunction = true;
expect(true).to.be.ok;
});
it('should be created even if 3rd party property has been set', function () {
@ -66,7 +66,7 @@ describe('c3 chart', function () {
it('update args', function () {
d3.select('#chart').html('');
args.bindto = '#chart';
expect(true).to.be.ok;
});
it('should be created', function () {
var svg = d3.select('#chart svg');
@ -78,7 +78,7 @@ describe('c3 chart', function () {
it('update args', function () {
d3.select('#chart').html('');
args.bindto = d3.select('#chart');
expect(true).to.be.ok;
});
it('should be created', function () {
var svg = d3.select('#chart svg');
@ -90,7 +90,7 @@ describe('c3 chart', function () {
it('update args', function () {
d3.select('#chart').html('');
args.bindto = null;
expect(true).to.be.ok;
});
it('should not be created', function () {
var svg = d3.select('#chart svg');
@ -102,7 +102,7 @@ describe('c3 chart', function () {
it('update args', function () {
d3.select('#chart').html('');
args.bindto = '';
expect(true).to.be.ok;
});
it('should not be created', function () {
var svg = d3.select('#chart svg');
@ -123,7 +123,7 @@ describe('c3 chart', function () {
]
}
};
expect(true).to.be.ok;
});
it('should generate a chart', function () {
@ -147,7 +147,7 @@ describe('c3 chart', function () {
}
}
};
expect(true).to.be.ok;
});
it('should generate a chart', function () {

78
spec-mocha/data-spec.js

@ -20,7 +20,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should draw correctly', function () {
@ -59,7 +59,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should draw correctly', function () {
@ -114,7 +114,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should draw nested JSON correctly', function () {
@ -181,7 +181,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should return false in isOrderAsc and isOrderDesc functions', function () {
@ -201,7 +201,7 @@ describe('c3 chart data', function () {
],
}
};
expect(true).to.be.ok;
});
describe('normal x', function () {
@ -242,7 +242,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have correct number of xs', function () {
@ -281,7 +281,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have correct number of xs', function () {
@ -328,7 +328,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have correct number of xs', function () {
@ -375,7 +375,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have correct number of xs', function () {
@ -414,7 +414,7 @@ describe('c3 chart data', function () {
labels: true,
}
};
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -441,7 +441,7 @@ describe('c3 chart data', function () {
it('should update args to be stacked', function () {
args.data.groups = [['data1', 'data2'], ['data3', 'data4']];
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -483,7 +483,7 @@ describe('c3 chart data', function () {
labels: true,
}
};
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -510,7 +510,7 @@ describe('c3 chart data', function () {
it('should update args to be stacked', function () {
args.data.groups = [['data1', 'data2'], ['data3', 'data4']];
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -552,7 +552,7 @@ describe('c3 chart data', function () {
labels: true,
}
};
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -579,7 +579,7 @@ describe('c3 chart data', function () {
it('should update args to be stacked', function () {
args.data.groups = [['data1', 'data2'], ['data3', 'data4']];
expect(true).to.be.ok;
});
it('should locate data labels in correct position', function () {
@ -619,7 +619,7 @@ describe('c3 chart data', function () {
labels: true
}
};
expect(true).to.be.ok;
});
it('should have data labels on all data', function () {
@ -655,7 +655,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have data labels on all data', function () {
@ -688,7 +688,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have data labels on all data', function () {
@ -717,7 +717,7 @@ describe('c3 chart data', function () {
labels: true
}
};
expect(true).to.be.ok;
});
it('should have proper y domain', function () {
@ -748,7 +748,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -770,7 +770,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -799,7 +799,7 @@ describe('c3 chart data', function () {
args.axis = {
rotated: true
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -821,7 +821,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -866,7 +866,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -888,7 +888,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -917,7 +917,7 @@ describe('c3 chart data', function () {
args.axis = {
rotated: true
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -939,7 +939,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -984,7 +984,7 @@ describe('c3 chart data', function () {
}
}
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1006,7 +1006,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1034,7 +1034,7 @@ describe('c3 chart data', function () {
args.axis = {
rotated: true
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1056,7 +1056,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1096,7 +1096,7 @@ describe('c3 chart data', function () {
type: 'bar',
}
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1118,7 +1118,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1147,7 +1147,7 @@ describe('c3 chart data', function () {
args.axis = {
rotated: true
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1169,7 +1169,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1209,7 +1209,7 @@ describe('c3 chart data', function () {
type: 'bar',
}
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1231,7 +1231,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1260,7 +1260,7 @@ describe('c3 chart data', function () {
args.axis = {
rotated: true
};
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {
@ -1282,7 +1282,7 @@ describe('c3 chart data', function () {
it('should update args', function () {
args.data.type = 'line';
expect(true).to.be.ok;
});
it('should have y domain with proper padding', function () {

14
spec-mocha/domain-spec.js

@ -26,7 +26,7 @@ describe('c3 chart domain', function () {
it('should change axis.y.min to -100', function () {
args.axis.y.min = -100;
expect(true).to.be.ok;
});
it('should be set properly when smaller than max of data', function () {
@ -37,7 +37,7 @@ describe('c3 chart domain', function () {
it('should change axis.y.min to 500', function () {
args.axis.y.min = 500;
expect(true).to.be.ok;
});
it('should be set properly when bigger than max of data', function () {
@ -48,7 +48,7 @@ describe('c3 chart domain', function () {
it('should change axis.y.min to undefined', function () {
args.axis.y.min = undefined;
expect(true).to.be.ok;
});
});
@ -57,7 +57,7 @@ describe('c3 chart domain', function () {
it('should change axis.y.max to 1000', function () {
args.axis.y.max = 1000;
expect(true).to.be.ok;
});
it('should be set properly when bigger than min of data', function () {
@ -68,7 +68,7 @@ describe('c3 chart domain', function () {
it('should change axis.y.max to 0', function () {
args.axis.y.max = 0;
expect(true).to.be.ok;
});
it('should be set properly when smaller than min of data', function () {
@ -95,7 +95,7 @@ describe('c3 chart domain', function () {
}
}
};
expect(true).to.be.ok;
});
it('should be set properly when bigger than min of data', function () {
@ -121,7 +121,7 @@ describe('c3 chart domain', function () {
}
}
};
expect(true).to.be.ok;
});
it('should be set properly when bigger than min of data', function () {

20
spec-mocha/grid-spec.js

@ -30,7 +30,7 @@ describe('c3 chart grid', function () {
}
}
};
expect(true).to.be.ok;
});
it('should not show y grids', function () {
@ -39,7 +39,7 @@ describe('c3 chart grid', function () {
it('should update args to show y grids', function () {
args.grid.y.show = true;
expect(true).to.be.ok;
});
it('should show y grids', function () {
@ -50,7 +50,7 @@ describe('c3 chart grid', function () {
it('should update args to show only 3 y grids', function () {
args.grid.y.ticks = 3;
expect(true).to.be.ok;
});
it('should show only 3 y grids', function () {
@ -61,7 +61,7 @@ describe('c3 chart grid', function () {
it('should update args to show y grids depending on y axis ticks', function () {
args.axis.y.tick.count = 5;
expect(true).to.be.ok;
});
it('should show grids depending on y axis ticks', function () {
@ -100,7 +100,7 @@ describe('c3 chart grid', function () {
}
}
};
expect(true).to.be.ok;
});
it('should show 3 grid lines', function () {
@ -149,7 +149,7 @@ describe('c3 chart grid', function () {
}
}
};
expect(true).to.be.ok;
});
it('should show 3 grid lines', function () {
@ -202,7 +202,7 @@ describe('c3 chart grid', function () {
}
},
};
expect(true).to.be.ok;
});
it('should show 3 grid lines', function () {
@ -251,7 +251,7 @@ describe('c3 chart grid', function () {
}
},
};
expect(true).to.be.ok;
});
it('should show 3 grid lines', function () {
@ -302,7 +302,7 @@ describe('c3 chart grid', function () {
top: 50
}
};
expect(true).to.be.ok;
});
it('should show x grid lines', function () {
@ -345,7 +345,7 @@ describe('c3 chart grid', function () {
}
}
};
expect(true).to.be.ok;
});
it('should show x grid lines', function () {

8
spec-mocha/interaction-spec.js

@ -24,7 +24,7 @@ describe('c3 chart interaction', function () {
type: 'bar'
}
};
expect(true).to.be.ok;
});
it('should have 4 event rects properly', function () {
@ -48,7 +48,7 @@ describe('c3 chart interaction', function () {
type: 'bar'
}
};
expect(true).to.be.ok;
});
it('should have 1 event rects properly', function () {
@ -74,7 +74,7 @@ describe('c3 chart interaction', function () {
]
}
};
expect(true).to.be.ok;
});
it('should have 4 event rects properly', function () {
@ -98,7 +98,7 @@ describe('c3 chart interaction', function () {
]
}
};
expect(true).to.be.ok;
});
it('should have 1 event rects properly', function () {

24
spec-mocha/legend-spec.js

@ -21,7 +21,7 @@ describe('c3 chart legend', function () {
]
}
};
expect(true).to.be.ok;
});
it('should update args with long data names', function () {
@ -34,7 +34,7 @@ describe('c3 chart legend', function () {
]
}
};
expect(true).to.be.ok;
});
it('should have properly computed legend width', function () {
@ -59,7 +59,7 @@ describe('c3 chart legend', function () {
]
}
};
expect(true).to.be.ok;
});
it('should be located on the center of chart', function () {
@ -86,7 +86,7 @@ describe('c3 chart legend', function () {
}
}
};
expect(true).to.be.ok;
});
it('should be positioned properly', function () {
@ -102,7 +102,7 @@ describe('c3 chart legend', function () {
it('should change the legend step to 1 successfully', function () {
args.legend.inset.step = 1;
expect(true).to.be.ok;
});
it('should have automatically calculated height', function () {
@ -112,7 +112,7 @@ describe('c3 chart legend', function () {
it('should change the legend step to 2 successfully', function () {
args.legend.inset.step = 2;
expect(true).to.be.ok;
});
it('should have automatically calculated height', function () {
@ -131,7 +131,7 @@ describe('c3 chart legend', function () {
position: 'inset'
}
};
expect(true).to.be.ok;
});
it('should locate legend properly', function () {
@ -156,7 +156,7 @@ describe('c3 chart legend', function () {
hide: true
}
};
expect(true).to.be.ok;
});
it('should not show legends', function () {
@ -177,7 +177,7 @@ describe('c3 chart legend', function () {
hide: 'data2'
}
};
expect(true).to.be.ok;
});
it('should not show legends', function () {
@ -201,7 +201,7 @@ describe('c3 chart legend', function () {
show: false
}
};
expect(true).to.be.ok;
});
it('should not initially have rendered any legend items', function () {
@ -237,7 +237,7 @@ describe('c3 chart legend', function () {
}
}
};
expect(true).to.be.ok;
});
it('renders the legend item with the correct width and height', function () {
@ -262,7 +262,7 @@ describe('c3 chart legend', function () {
padding: 10
}
};
expect(true).to.be.ok;
});
it('renders the correct amount of padding on the legend element', function () {

10
spec-mocha/shape.bar-spec.js

@ -27,7 +27,7 @@ describe('c3 chart shape bar', function () {
type: 'bar'
},
};
expect(true).to.be.ok;
});
it('should be stacked', function () {
var expectedBottom = [275, 293, 365, 281, 395, 290];
@ -59,7 +59,7 @@ describe('c3 chart shape bar', function () {
}
}
};
expect(true).to.be.ok;
});
it('should be stacked', function () {
var expectedBottom = [275, 293, 365, 281, 395, 290];
@ -91,7 +91,7 @@ describe('c3 chart shape bar', function () {
}
}
};
expect(true).to.be.ok;
});
it('should be stacked', function () {
var expectedBottom = [275, 293, 365, 281, 395, 290];
@ -122,7 +122,7 @@ describe('c3 chart shape bar', function () {
rotated: false
}
};
expect(true).to.be.ok;
});
it('should not be within bar', function () {
@ -155,7 +155,7 @@ describe('c3 chart shape bar', function () {
it('should change the chart as axis rotated', function () {
args.axis.rotated = true;
expect(true).to.be.ok;
});
it('should not be within bar', function () {

14
spec-mocha/shape.line-spec.js

@ -24,7 +24,7 @@ describe('c3 chart shape line', function () {
type: 'line'
}
};
expect(true).to.be.ok;
});
@ -46,7 +46,7 @@ describe('c3 chart shape line', function () {
it('should change to step chart', function () {
args.data.type = 'step';
expect(true).to.be.ok;
});
it("should have shape-rendering = crispedges when it's step chart", function () {
@ -58,7 +58,7 @@ describe('c3 chart shape line', function () {
it('should change to spline chart', function () {
args.data.type = 'spline';
expect(true).to.be.ok;
});
it('should use cardinal interpolation by default', function () {
@ -80,7 +80,7 @@ describe('c3 chart shape line', function () {
type: 'line'
}
};
expect(true).to.be.ok;
});
it('should not show the circle for null', function (done) {
@ -117,7 +117,7 @@ describe('c3 chart shape line', function () {
// type: 'scatter'
// }
// };
// expect(true).to.be.ok;
//
// });
// it('should not show the circle for null', function (done) {
@ -151,7 +151,7 @@ describe('c3 chart shape line', function () {
}
};
expect(true).to.be.ok;
});
it('should update interpolation function', function() {
@ -160,7 +160,7 @@ describe('c3 chart shape line', function () {
it('should not use a non-valid interpolation', function () {
args.spline.interpolation.type = 'foo';
expect(true).to.be.ok;
});
it('should use cardinal interpolation when given option is not valid', function() {

2
spec-mocha/tooltip-spec.js

@ -49,7 +49,7 @@ describe('c3 chart tooltip', function () {
it('should set left margin', function () {
d3.select('#chart').style('margin-left', '300px');
expect(true).to.be.ok;
});
it('should show tooltip on proper position', function () {

14
spec-mocha/type-spec.js

@ -24,7 +24,7 @@ describe('c3 chart types', function () {
type: 'pie'
}
};
expect(true).to.be.ok;
});
it('should return true', function () {
@ -33,7 +33,7 @@ describe('c3 chart types', function () {
it('should change chart type to "bar"', function () {
args.data.type = 'bar';
expect(true).to.be.ok;
});
it('should return false', function () {
@ -51,7 +51,7 @@ describe('c3 chart types', function () {
type: 'pie'
}
};
expect(true).to.be.ok;
});
it('should return true', function () {
@ -60,7 +60,7 @@ describe('c3 chart types', function () {
it('should change chart type to "bar"', function () {
args.data.type = 'bar';
expect(true).to.be.ok;
});
it('should return false', function () {
@ -84,7 +84,7 @@ describe('c3 chart types', function () {
type: 'pie'
}
};
expect(true).to.be.ok;
});
it('should return true for "pie" type', function () {
@ -101,7 +101,7 @@ describe('c3 chart types', function () {
it('should unload successfully', function () {
chart.unload([]);
expect(true).to.be.ok;
});
it('should return true for "pie" type even if no data', function () {
@ -118,7 +118,7 @@ describe('c3 chart types', function () {
it('should change chart type to "bar" successfully', function () {
args.data.type = 'bar';
expect(true).to.be.ok;
});
it('should return false for "pie" type even if no data', function () {

Loading…
Cancel
Save