8000 Misc perf improvements by alexcjohnson · Pull Request #1772 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
standardize fail logic in bar test
  • Loading branch information
alexcjohnson committed Jun 9, 2017
commit 434dc0edc8ef2e8a0ee8215e4c3b985c142c63a5
53 changes: 28 additions & 25 deletions test/jasmine/tests/bar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ var Plotly = require('@lib/index');
var Bar = require('@src/traces/bar');
var Lib = require('@src/lib');
var Plots = require('@src/plots/plots');
var Drawing = require('@src/components/drawing');

var PlotlyInternal = require('@src/plotly');
var Axes = PlotlyInternal.Axes;
var Axes = require('@src/plots/cartesian/axes');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
var fail = require('../assets/fail_test');
var customMatchers = require('../assets/custom_matchers');
var failTest = require('../assets/fail_test');

describe('Bar.supplyDefaults', function() {
'use strict';
Expand Down Expand Up @@ -855,9 +854,9 @@ describe('A bar plot', function() {
}

expect(foundTextNodes).toBe(true);

done();
});
})
.catch(fail)
.then(done);
});

it('should show bar texts (outside case)', function(done) {
Expand Down Expand Up @@ -889,9 +888,9 @@ describe('A bar plot', function() {
}

expect(foundTextNodes).toBe(true);

done();
});
})
.catch(fail)
.then(done);
});

it('should show bar texts (horizontal case)', function(done) {
Expand Down Expand Up @@ -922,9 +921,9 @@ describe('A bar plot', function() {
}

expect(foundTextNodes).toBe(true);

done();
});
})
.catch(fail)
.then(done);
});

it('should show bar texts (barnorm case)', function(done) {
Expand Down Expand Up @@ -957,9 +956,9 @@ describe('A bar plot', function() {
}

expect(foundTextNodes).toBe(true);

done();
});
})
.catch(fail)
.then(done);
});

it('should be able to restyle', function(done) {
Expand Down Expand Up @@ -1107,9 +1106,9 @@ describe('A bar plot', function() {
assertTextIsInsidePath(text12, path12); // inside
assertTextIsInsidePath(text20, path20); // inside
assertTextIsInsidePath(text30, path30); // inside

done();
});
})
.catch(fail)
.then(done);
});

it('should coerce text-related attributes', function(done) {
Expand Down Expand Up @@ -1189,9 +1188,9 @@ describe('A bar plot', function() {
assertTextFont(textNodes[0], expected.insidetextfont, 0);
assertTextFont(textNodes[1], expected.outsidetextfont, 1);
assertTextFont(textNodes[2], expected.insidetextfont, 2);

done();
});
})
.catch(fail)
.then(done);
});
});

Expand Down Expand Up @@ -1248,7 +1247,9 @@ describe('bar hover', function() {

var mock = Lib.extendDeep({}, require('@mocks/11.json'));

Plotly.plot(gd, mock.data, mock.layout).then(done);
Plotly.plot(gd, mock.data, mock.layout)
.catch(fail)
.then(done);
});

it('should return the correct hover point data (case x)', function() {
Expand All @@ -1272,7 +1273,9 @@ describe('bar hover', function() {

var mock = Lib.extendDeep({}, require('@mocks/bar_attrs_group_norm.json'));

Plotly.plot(gd, mock.data, mock.layout).then(done);
Plotly.plot(gd, mock.data, mock.layout)
.catch(fail)
.then(done);
});

it('should return the correct hover point data (case y)', function() {
Expand Down Expand Up @@ -1387,7 +1390,7 @@ describe('bar hover', function() {
expect(out).toBe(false, hoverSpec);
});
})
.catch(failTest)
.catch(fail)
.then(done);
});

Expand Down Expand Up @@ -1425,7 +1428,7 @@ describe('bar hover', function() {
expect(out.style).toEqual([1, 'red', 200, 1]);
assertPos(out.pos, [203, 304, 168, 168]);
})
.catch(failTest)
.catch(fail)
.then(done);
});
});
Expand Down
0