File tree Expand file tree Collapse file tree 4 files changed +20
-24
lines changed Expand file tree Collapse file tree 4 files changed +20
-24
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ module . exports = function createGraphDiv ( ) {
4
+ var gd = document . createElement ( 'div' ) ;
5
+ gd . id = 'graph' ;
6
+ document . body . appendChild ( gd ) ;
7
+ return gd ;
8
+ } ;
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ module . exports = function destroyGraphDiv ( ) {
4
+ var gd = document . getElementById ( 'graph' ) ;
5
+ document . body . removeChild ( gd ) ;
6
+ } ;
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ var d3 = require('d3');
2
2
3
3
var Plotly = require ( '@src/index' ) ;
4
4
5
+ var createGraphDiv = require ( '../assets/create_graph_div' ) ;
6
+ var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
7
+
5
8
/*
6
9
* WebGL interaction test cases fail on the CircleCI
7
10
* most likely due to a WebGL/driver issue
@@ -12,18 +15,6 @@ var Plotly = require('@src/index');
12
15
describe ( 'Test plot structure' , function ( ) {
13
16
'use strict' ;
14
17
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
18
afterEach ( destroyGraphDiv ) ;
28
19
29
20
describe ( 'gl3d plots' , function ( ) {
Original file line number Diff line number Diff line change @@ -3,22 +3,13 @@ var d3 = require('d3');
3
3
var Plotly = require ( '@src/index' ) ;
4
4
var Fx = require ( '@src/plots/cartesian/graph_interact' ) ;
5
5
6
+ var createGraphDiv = require ( '../assets/create_graph_div' ) ;
7
+ var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
8
+
6
9
7
10
describe ( 'Test plot structure' , function ( ) {
8
11
'use strict' ;
9
12
10
- function createGraphDiv ( ) {
11
- var gd = document . createElement ( 'div' ) ;
12
- gd . id = 'graph' ;
13
- document . body . appendChild ( gd ) ;
14
- return gd ;
15
- }
16
-
17
- function destroyGraphDiv ( ) {
18
- var gd = document . getElementById ( 'graph' ) ;
19
- document . body . removeChild ( gd ) ;
20
- }
21
-
22
13
afterEach ( destroyGraphDiv ) ;
23
14
24
15
describe ( 'cartesian plots' , function ( ) {
You can’t perform that action at this time.
0 commit comments