Skip to content

Commit

Permalink
revert mocha to v3 because v6 breaks chart/rangeBand unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
samussiah committed May 17, 2019
1 parent 8ef75dc commit 147b208
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/chart/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ export default function testLayout(settings, data) {
it('creates an x-axis g child element of svg', () => {
const xAxis = svgChildren.filter(
child =>
child.nodeName.toLowerCase() === 'g' && child.className.indexOf('x axis') > -1
child.nodeName.toLowerCase() === 'g' && [...child.classList].join(' ').indexOf('x axis') > -1
);
expect(xAxis.length).toEqual(1);
});

it('creates a y-axis g child element of svg', () => {
const yAxis = svgChildren.filter(
child =>
child.nodeName.toLowerCase() === 'g' && child.className.indexOf('y axis') > -1
child.nodeName.toLowerCase() === 'g' && [...child.classList].join(' ').indexOf('y axis') > -1
);
expect(yAxis.length).toEqual(1);
});
Expand All @@ -53,7 +53,7 @@ export default function testLayout(settings, data) {
const overlay = svgChildren.filter(
child =>
child.nodeName.toLowerCase() === 'rect' &&
child.className.indexOf('overlay') > -1
[...child.classList].join(' ').indexOf('overlay') > -1
);
expect(overlay.length).toEqual(1);
});
Expand All @@ -64,7 +64,7 @@ export default function testLayout(settings, data) {
.filter(
child =>
child.nodeName.toLowerCase() === 'ul' &&
child.className.indexOf('legend') > -1
[...child.classList].join(' ').indexOf('legend') > -1
);
expect(legend.length).toEqual(1);
});
Expand Down
5 changes: 4 additions & 1 deletion test/chart/rangeBand.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export default function testRangeBand(settings, data) {

//DOM setup
before(() => {
container = window.document.createElement('div');
dom = new JSDOM('<!DOCTYPE html>');
container = dom.window.document.createElement('div');
chart = createChart(container, settings);
chart.init(data, true);
});

//Chart initialization
Expand Down
6 changes: 1 addition & 5 deletions test/testNewUnitTests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
import './chart/rangeBand';
import testRangeBand from './chart/rangeBand';
import { ordinal_ordinal as ordinal_ordinal_rb } from './samples/irisSettings';
import rangeBandData from './samples/irisData';
testRangeBand(ordinal_ordinal_rb, rangeBandData);
//import './folder/unit-test';

0 comments on commit 147b208

Please sign in to comment.