@@ -9,6 +9,13 @@ var destroyGraphDiv = require('../assets/destroy_graph_div');
9
9
describe ( 'Test plot structure' , function ( ) {
10
10
'use strict' ;
11
11
12
+ function assertNamespaces ( node ) {
13
+ expect ( node . getAttribute ( 'xmlns' ) )
14
+ . toEqual ( 'http://www.w3.org/2000/svg' ) ;
15
+ expect ( node . getAttribute ( 'xmlns:xlink' ) )
16
+ . toEqual ( 'http://www.w3.org/1999/xlink' ) ;
17
+ }
18
+
12
19
afterEach ( destroyGraphDiv ) ;
13
20
14
21
describe ( 'cartesian plots' , function ( ) {
@@ -44,6 +51,15 @@ describe('Test plot structure', function() {
44
51
45
52
expect ( nodes . size ( ) ) . toEqual ( Npts ) ;
46
53
} ) ;
54
+
55
+ it ( 'has the correct name spaces' , function ( ) {
56
+ var mainSVGs = d3 . selectAll ( '.main-svg' ) ;
57
+
58
+ mainSVGs . each ( function ( ) {
59
+ var node = this ;
60
+ assertNamespaces ( node ) ;
61
+ } ) ;
62
+ } ) ;
47
63
} ) ;
48
64
49
65
describe ( 'pie traces' , function ( ) {
@@ -63,6 +79,18 @@ describe('Test plot structure', function() {
63
79
64
80
expect ( nodes . size ( ) ) . toEqual ( Npts ) ;
65
81
} ) ;
82
+
83
+ it ( 'has the correct name spaces' , function ( ) {
84
+ var mainSVGs = d3 . selectAll ( '.main-svg' ) ;
85
+
86
+ mainSVGs . each ( function ( ) {
87
+ var node = this ;
88
+ assertNamespaces ( node ) ;
89
+ } ) ;
90
+
91
+ var testerSVG = d3 . selectAll ( '#js-plotly-tester' ) ;
92
+ assertNamespaces ( testerSVG . node ( ) ) ;
93
+ } ) ;
66
94
} ) ;
67
95
} ) ;
68
96
@@ -96,6 +124,22 @@ describe('Test plot structure', function() {
96
124
97
125
expect ( nodes . size ( ) ) . toEqual ( Npts ) ;
98
126
} ) ;
127
+
128
+ it ( 'has the correct name spaces' , function ( ) {
129
+ var mainSVGs = d3 . selectAll ( '.main-svg' ) ;
130
+
131
+ mainSVGs . each ( function ( ) {
132
+ var node = this ;
133
+ assertNamespaces ( node ) ;
134
+ } ) ;
135
+
136
+ var geoSVGs = d3 . select ( '#geo' ) . selectAll ( 'svg' ) ;
137
+
138
+ geoSVGs . each ( function ( ) {
139
+ var node = this ;
140
+ assertNamespaces ( node ) ;
141
+ } ) ;
142
+ } ) ;
99
143
} ) ;
100
144
101
145
describe ( 'polar plots' , function ( ) {
0 commit comments