@@ -86,54 +86,6 @@ describe('Plotly.downloadImage', function() {
8686 } )
8787 . then ( done , done . fail ) ;
8888 } , LONG_TIMEOUT_INTERVAL ) ;
89-
90- it ( 'should produce the right SVG output in IE' , function ( done ) {
91- // mock up IE behavior
92- spyOn ( Lib , 'isIE' ) . and . callFake ( function ( ) { return true ; } ) ;
93- spyOn ( slzProto , 'serializeToString' ) . and . callFake ( function ( ) {
94- return serializeToString . apply ( this , arguments )
95- . replace ( / ( \( # ) ( [ ^ " ) ] * ) ( \) ) / gi, '(\"#$2\")' ) ;
96- } ) ;
97- var savedBlob ;
98- window . navigator . msSaveBlob = function ( blob ) { savedBlob = blob ; } ;
99-
100- var expectedStart = '<svg class=\'main-svg\' xmlns=\'http://www.w3.org/2000/svg\' xmlns:xlink=\'http://www.w3.org/1999/xlink\'' ;
101- var plotClip = / c l i p - p a t h = ' u r l \( " # c l i p [ 0 - 9 a - f ] { 6 } x y p l o t " \) / ;
102- var legendClip = / c l i p - p a t h = \' u r l \( " # l e g e n d [ 0 - 9 a - f ] { 6 } " \) / ;
103-
104- Plotly . newPlot ( gd , textchartMock . data , textchartMock . layout )
105- . then ( function ( gd ) {
106- savedBlob = undefined ;
107- return Plotly . downloadImage ( gd , {
108- format : 'svg' ,
109- height : 300 ,
110- width : 300 ,
111- filename : 'plotly_download'
112- } ) ;
113- } )
114- . then ( function ( ) {
115- if ( savedBlob === undefined ) {
116- fail ( 'undefined saveBlob' ) ;
117- }
118-
119- return new Promise ( function ( resolve , reject ) {
120- var reader = new FileReader ( ) ;
121- reader . onloadend = function ( ) {
122- var res = reader . result ;
123-
124- expect ( res . substr ( 0 , expectedStart . length ) ) . toBe ( expectedStart ) ;
125- expect ( res . match ( plotClip ) ) . not . toBe ( null ) ;
126- expect ( res . match ( legendClip ) ) . not . toBe ( null ) ;
127-
128- resolve ( ) ;
129- } ;
130- reader . onerror = function ( e ) { reject ( e ) ; } ;
131-
132- reader . readAsText ( savedBlob ) ;
133- } ) ;
134- } )
135- . then ( done , done . fail ) ;
136- } , LONG_TIMEOUT_INTERVAL ) ;
13789} ) ;
13890
13991function downloadTest ( gd , format ) {
0 commit comments