@@ -254,7 +254,7 @@ describe('Plotly.Snapshot', function() {
254
254
describe ( 'should handle quoted style properties' , function ( ) {
255
255
function checkURL ( actual , msg ) {
256
256
// which is enough tot check that toSVG did its job right
257
- expect ( ( actual || '' ) . substr ( 0 , 6 ) ) . toBe ( 'url(\" #' , msg ) ;
257
+ expect ( ( actual || '' ) . substr ( 0 , 5 ) ) . toBe ( 'url(#' , msg ) ;
258
258
}
259
259
260
260
it ( '- marker-gradient case' , function ( done ) {
@@ -277,7 +277,7 @@ describe('Plotly.Snapshot', function() {
277
277
} ) ;
278
278
279
279
d3 . selectAll ( '.point,.scatterpts' ) . each ( function ( ) {
280
- checkURL ( this . style . fill ) ;
280
+ checkURL ( d3 . select ( this ) . attr ( ' fill' ) ) ;
281
281
} ) ;
282
282
283
283
return Plotly . Snapshot . toSVG ( gd ) ;
@@ -297,12 +297,12 @@ describe('Plotly.Snapshot', function() {
297
297
expect ( pointElements . length ) . toEqual ( 3 ) ;
298
298
299
299
for ( i = 0 ; i < pointElements . length ; i ++ ) {
300
- checkURL ( pointElements [ i ] . style . fill ) ;
300
+ checkURL ( pointElements [ i ] . getAttribute ( ' fill' ) ) ;
301
301
}
302
302
303
303
var legendPointElements = svgDOM . getElementsByClassName ( 'scatterpts' ) ;
304
304
expect ( legendPointElements . length ) . toEqual ( 1 ) ;
305
- checkURL ( legendPointElements [ 0 ] . style . fill ) ;
305
+ checkURL ( legendPointElements [ 0 ] . getAttribute ( ' fill' ) ) ;
306
306
} )
307
307
. catch ( failTest )
308
308
. then ( done ) ;
@@ -319,11 +319,12 @@ describe('Plotly.Snapshot', function() {
319
319
320
320
var fillItems = svgDOM . getElementsByClassName ( 'legendfill' ) ;
321
321
for ( var i = 0 ; i < fillItemIndices . length ; i ++ ) {
322
- checkURL ( fillItems [ fillItemIndices [ i ] ] . firstChild . style . fill , 'fill gradient ' + i ) ;
322
+ var path = fillItems [ fillItemIndices [ i ] ] . firstChild ;
323
+ checkURL ( path . getAttribute ( 'fill' ) , 'fill gradient ' + i ) ;
323
324
}
324
325
325
326
var lineItems = svgDOM . getElementsByClassName ( 'legendlines' ) ;
326
- checkURL ( lineItems [ 1 ] . firstChild . style . stroke , 'stroke gradient' ) ;
327
+ checkURL ( lineItems [ 1 ] . firstChild . getAttribute ( ' stroke' ) , 'stroke gradient' ) ;
327
328
} )
328
329
. catch ( failTest )
329
330
. then ( done ) ;
@@ -340,7 +341,7 @@ describe('Plotly.Snapshot', function() {
340
341
var fillItems = svgDOM . getElementsByClassName ( 'cbfill' ) ;
341
342
expect ( fillItems . length ) . toBe ( 1 , '# of colorbars' ) ;
342
343
for ( var i = 0 ; i < fillItems . length ; i ++ ) {
343
- checkURL ( fillItems [ i ] . style . fill , 'fill gradient ' + i ) ;
344
+ checkURL ( fillItems [ i ] . getAttribute ( ' fill' ) , 'fill gradient ' + i ) ;
344
345
}
345
346
} )
346
347
. catch ( failTest )
0 commit comments