Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1970855

Browse files
committed
mv gl plot interact tests to gl_plot_interact_test file:
- exclude that test file on circleci runs - that way, gl plot interactions can be tested locally
1 parent 6add1a4 commit 1970855

File tree

3 files changed

+60
-26
lines changed

3 files changed

+60
-26
lines changed

test/jasmine/karma.ciconf.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ function func(config) {
77
func.defaultConfig.logLevel = config.LOG_INFO;
88

99
// Continuous Integration mode
10+
11+
// exclude the WebGL interaction test on circle runs
12+
func.defaultConfig.exclude = ['tests/gl_plot_interact_test.js'];
13+
1014
// if true, Karma captures browsers, runs the tests and exits
1115
func.defaultConfig.singleRun = true;
1216

@@ -16,6 +20,7 @@ function func(config) {
1620

1721
func.defaultConfig.browsers = ['Firefox'];
1822

23+
1924
config.set(func.defaultConfig);
2025
}
2126

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
var d3 = require('d3');
2+
3+
var Plotly = require('@src/index');
4+
5+
/*
6+
* The following test cases fail on the CircleCI
7+
* most likely due to a WebGL/driver issue
8+
*
9+
*/
10+
11+
12+
describe('Test plot structure', function () {
13+
'use strict';
14+
15+
function createGraphDiv() {
16+
var gd = document.createElement('div');
17+
gd.id = 'graph';
18+
document.body.appendChild(gd);
19+
return gd;
20+
}
21+
22+
function destroyGraphDiv() {
23+
var gd = document.getElementById('graph');
24+
document.body.removeChild(gd);
25+
}
26+
27+
afterEach(destroyGraphDiv);
28+
29+
describe('gl3d plots', function() {
30+
var mock = require('@mocks/gl3d_marker-arrays.json');
31+
32+
beforeEach(function(done) {
33+
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
34+
});
35+
36+
it('has one *canvas* node', function() {
37+
var nodes = d3.selectAll('canvas');
38+
expect(nodes[0].length).toEqual(1);
39+
});
40+
});
41+
42+
describe('gl2d plots', function() {
43+
var mock = require('@mocks/gl2d_10.json');
44+
45+
beforeEach(function(done) {
46+
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
47+
});
48+
49+
it('has one *canvas* node', function() {
50+
var nodes = d3.selectAll('canvas');
51+
expect(nodes[0].length).toEqual(1);
52+
});
53+
});
54+
55+
});

test/jasmine/tests/plot_interact_test.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,32 +98,6 @@ describe('Test plot structure', function () {
9898

9999
});
100100

101-
describe('gl3d plots', function() {
102-
var mock = require('@mocks/gl3d_marker-arrays.json');
103-
104-
beforeEach(function(done) {
105-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
106-
});
107-
108-
it('has one *canvas* node', function() {
109-
var nodes = d3.selectAll('canvas');
110-
expect(nodes[0].length).toEqual(1);
111-
});
112-
});
113-
114-
describe('gl2d plots', function() {
115-
var mock = require('@mocks/gl2d_10.json');
116-
117-
beforeEach(function(done) {
118-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
119-
});
120-
121-
it('has one *canvas* node', function() {
122-
var nodes = d3.selectAll('canvas');
123-
expect(nodes[0].length).toEqual(1);
124-
});
125-
});
126-
127101
describe('geo plots', function() {
128102
var mock = require('@mocks/geo_first.json');
129103

0 commit comments

Comments
 (0)