Skip to content

Shard gl jasmine tests #2933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion test/jasmine/tests/gl2d_click_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ describe('Test hover and click interactions', function() {
gd = createGraphDiv();
});

afterEach(function() {
afterEach(function(done) {
Plotly.purge(gd);
destroyGraphDiv();
setTimeout(done, 1000);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to reduce the number of intermittent failures (and the number of retry attempts) a little.

});

it('@gl should output correct event data for scattergl', function(done) {
Expand Down
20 changes: 15 additions & 5 deletions test/jasmine/tests/gl2d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ describe('Test removal of gl contexts', function() {
gd = createGraphDiv();
});

afterEach(destroyGraphDiv);
afterEach(function() {
Plotly.purge(gd);
destroyGraphDiv();
});

it('@gl Plots.cleanPlot should remove gl context from the graph div of a gl2d plot', function(done) {
Plotly.plot(gd, [{
Expand All @@ -41,6 +44,7 @@ describe('Test removal of gl contexts', function() {

expect(!!gd._fullLayout._plots.xy._scene).toBe(false);
})
.catch(failTest)
.then(done);
});

Expand Down Expand Up @@ -83,6 +87,7 @@ describe('Test removal of gl contexts', function() {
firstCanvas !== secondCanvas && firstGlContext.isContextLost()
);
})
.catch(failTest)
.then(done);
});
});
Expand All @@ -94,9 +99,10 @@ describe('Test gl plot side effects', function() {
gd = createGraphDiv();
});

afterEach(function() {
afterEach(function(done) {
Plotly.purge(gd);
destroyGraphDiv();
setTimeout(done, 1000);
});

it('@gl should not draw the rangeslider', function(done) {
Expand All @@ -118,6 +124,7 @@ describe('Test gl plot side effects', function() {
var rangeSlider = document.getElementsByClassName('range-slider')[0];
expect(rangeSlider).not.toBeDefined();
})
.catch(failTest)
.then(done);
});

Expand Down Expand Up @@ -160,11 +167,12 @@ describe('Test gl plot side effects', function() {

return Plotly.purge(gd);
})
.catch(failTest)
.then(done);
});

it('@gl should be able to switch trace type', function(done) {
Plotly.newPlot(gd, [{
Plotly.plot(gd, [{
type: 'parcoords',
x: [1, 2, 3],
y: [2, 1, 2],
Expand All @@ -184,6 +192,7 @@ describe('Test gl plot side effects', function() {
.then(function() {
expect(d3.selectAll('canvas').size()).toEqual(0);
})
.catch(failTest)
.then(done);
});

Expand All @@ -197,7 +206,7 @@ describe('Test gl plot side effects', function() {
.then(function() {
expect(gd.querySelector('.gl-canvas-context').width).toBe(600);

Plotly.relayout(gd, {width: 300});
return Plotly.relayout(gd, {width: 300});
})
.then(function() {
expect(gd.querySelector('.gl-canvas-context').width).toBe(300);
Expand All @@ -216,9 +225,10 @@ describe('Test gl2d plots', function() {
gd = createGraphDiv();
});

afterEach(function() {
afterEach(function(done) {
Plotly.purge(gd);
destroyGraphDiv();
setTimeout(done, 1000);
});

function mouseTo(p0, p1) {
Expand Down