File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -306,17 +306,17 @@ describe('Layout images', function() {
306306 return element ;
307307 } ) ;
308308
309- Plotly . relayout ( gd , 'images[0].source' , dataUriImage ) . then ( function ( ) {
310- setTimeout ( function ( ) {
311- expect ( newCanvasElement ) . toBeUndefined ( ) ;
312- Plotly . relayout ( gd , 'images[0].source' , pythonLogo ) . then ( function ( ) {
313- expect ( newCanvasElement ) . eventually . toBeDefined ( ) ;
314- expect ( newCanvasElement . toDataURL ) . toHaveBeenCalledTimes ( 1 ) ;
315- } ) ;
316-
317- done ( ) ;
318- } , 500 ) ;
319- } ) ;
309+ Plotly . relayout ( gd , 'images[0].source' , dataUriImage )
310+ . then ( function ( ) {
311+ expect ( newCanvasElement ) . toBeUndefined ( ) ;
312+ } )
313+ . then ( function ( ) { return Plotly . relayout ( gd , 'images[0].source' , jsLogo ) ; } )
314+ . then ( function ( ) {
315+ expect ( newCanvasElement ) . toBeDefined ( ) ;
316+ expect ( newCanvasElement . toDataURL ) . toHaveBeenCalledTimes ( 1 ) ;
317+ } )
318+ . catch ( failTest )
319+ . then ( done ) ;
320320 } ) ;
321321
322322 it ( 'should update the image if changed' , function ( done ) {
You can’t perform that action at this time.
0 commit comments