Skip to content

Commit 0cc1c82

Browse files
authored
Merge pull request #5633 from plotly/fixup-parcoords-karma
Adjust parcoords tests and revise karma config
2 parents 4b73fc3 + 9da91af commit 0cc1c82

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

test/jasmine/karma.conf.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ func.defaultConfig = {
218218
singleRun: argv.nowatch,
219219

220220
// how long will Karma wait for a message from a browser before disconnecting (30 ms)
221-
browserNoActivityTimeout: 30000,
221+
browserNoActivityTimeout: 60000,
222+
223+
// how long does Karma wait for a browser to reconnect (in ms).
224+
browserDisconnectTimeout: 60000,
222225

223226
// start these browsers
224227
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher

test/jasmine/tests/parcoords_test.js

+20-25
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,6 @@ function mostOfDrag(x1, y1, x2, y2) {
5858
mouseEvent('mousemove', x2, y2);
5959
}
6060

61-
function purgeGraphDiv(done) {
62-
var gd = d3Select('.js-plotly-plot').node();
63-
if(gd) Plotly.purge(gd);
64-
destroyGraphDiv();
65-
66-
return delay(50)().then(done);
67-
}
68-
6961
function getAvgPixelByChannel(id) {
7062
var canvas = d3Select(id).node();
7163

@@ -371,12 +363,12 @@ describe('parcoords initialization tests', function() {
371363
describe('parcoords edge cases', function() {
372364
var gd;
373365
beforeEach(function() {
374-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
366+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
375367

376368
gd = createGraphDiv();
377369
});
378370

379-
afterEach(purgeGraphDiv);
371+
afterEach(destroyGraphDiv);
380372

381373
it('@gl Works fine with one panel only', function(done) {
382374
var mockCopy = Lib.extendDeep({}, mock2);
@@ -644,8 +636,11 @@ describe('parcoords edge cases', function() {
644636

645637
describe('parcoords Lifecycle methods', function() {
646638
var gd;
647-
beforeEach(function() { gd = createGraphDiv(); });
648-
afterEach(purgeGraphDiv);
639+
beforeEach(function() {
640+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
641+
gd = createGraphDiv();
642+
});
643+
afterEach(destroyGraphDiv);
649644

650645
it('Plotly.deleteTraces with one trace removes the plot', function(done) {
651646
var mockCopy = Lib.extendDeep({}, mock);
@@ -904,7 +899,7 @@ describe('parcoords basic use', function() {
904899
var gd;
905900

906901
beforeEach(function() {
907-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
902+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
908903

909904
mockCopy = Lib.extendDeep({}, mock);
910905
mockCopy.data[0].domain = {
@@ -915,7 +910,7 @@ describe('parcoords basic use', function() {
915910
gd = createGraphDiv();
916911
});
917912

918-
afterEach(purgeGraphDiv);
913+
afterEach(destroyGraphDiv);
919914

920915
it('@gl should create three WebGL contexts per graph', function(done) {
921916
Plotly.react(gd, mockCopy)
@@ -1220,10 +1215,11 @@ describe('parcoords react more attributes', function() {
12201215
var gd;
12211216

12221217
beforeEach(function() {
1218+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
12231219
gd = createGraphDiv();
12241220
});
12251221

1226-
afterEach(purgeGraphDiv);
1222+
afterEach(destroyGraphDiv);
12271223

12281224
it('@gl should change various axis parameters', function(done) {
12291225
Plotly.react(gd, mock3)
@@ -1365,22 +1361,21 @@ describe('parcoords constraint interactions - without defined axis ranges', func
13651361
var snapDelay = 100;
13661362
var noSnapDelay = 20;
13671363
beforeAll(function() {
1368-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
1369-
13701364
initialSnapDuration = PC.bar.snapDuration;
13711365
PC.bar.snapDuration = shortenedSnapDuration;
13721366
});
13731367

13741368
afterAll(function() {
1375-
purgeGraphDiv();
1369+
destroyGraphDiv();
13761370
PC.bar.snapDuration = initialSnapDuration;
13771371
});
13781372

13791373
beforeEach(function() {
1374+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
13801375
gd = createGraphDiv();
13811376
});
13821377

1383-
afterEach(purgeGraphDiv);
1378+
afterEach(destroyGraphDiv);
13841379

13851380
function getDashArray(index) {
13861381
var highlight = document.querySelectorAll('.highlight')[index];
@@ -1651,22 +1646,21 @@ describe('parcoords constraint interactions - with defined axis ranges', functio
16511646
var shortenedSnapDuration = 20;
16521647
var noSnapDelay = 20;
16531648
beforeAll(function() {
1654-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
1655-
16561649
initialSnapDuration = PC.bar.snapDuration;
16571650
PC.bar.snapDuration = shortenedSnapDuration;
16581651
});
16591652

16601653
afterAll(function() {
1661-
purgeGraphDiv();
1654+
destroyGraphDiv();
16621655
PC.bar.snapDuration = initialSnapDuration;
16631656
});
16641657

16651658
beforeEach(function() {
1659+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
16661660
gd = createGraphDiv();
16671661
});
16681662

1669-
afterEach(purgeGraphDiv);
1663+
afterEach(destroyGraphDiv);
16701664

16711665
it('@gl updates constraints above and below axis ranges', function(done) {
16721666
var x = 295;
@@ -1740,15 +1734,16 @@ describe('parcoords constraint click interactions - with pre-defined constraint
17401734
});
17411735

17421736
afterAll(function() {
1743-
purgeGraphDiv();
1737+
destroyGraphDiv();
17441738
PC.bar.snapDuration = initialSnapDuration;
17451739
});
17461740

17471741
beforeEach(function() {
1742+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000;
17481743
gd = createGraphDiv();
17491744
});
17501745

1751-
afterEach(purgeGraphDiv);
1746+
afterEach(destroyGraphDiv);
17521747

17531748
it('@gl should not drop constraintrange on click', function(done) {
17541749
Plotly.react(gd, initialFigure())

0 commit comments

Comments
 (0)