@@ -48,44 +48,6 @@ describe('PlotlyService', () => {
48
48
PlotlyService . setModuleName ( undefined ) ;
49
49
} ) ;
50
50
51
- it ( 'should call plotly.newPlot method' , inject ( [ PlotlyService ] , async ( service : PlotlyService ) => {
52
- return new Promise < void > ( async ( resolve ) => {
53
- const plotly = await ( service as any ) . getPlotly ( ) ;
54
- PlotlyService . setPlotly ( 'waiting' ) ;
55
-
56
- setTimeout ( ( ) => PlotlyService . setPlotly ( PlotlyJS ) , 100 ) ;
57
-
58
- spyOn ( plotly , 'newPlot' ) . and . returnValue ( Promise . resolve ( ) ) ;
59
- await service . newPlot ( 'one' as any , 'two' as any , 'three' as any , 'four' as any ) ;
60
- expect ( plotly . newPlot ) . toHaveBeenCalledWith ( 'one' , 'two' , 'three' , 'four' ) ;
61
-
62
- await service . newPlot ( 'one' as any , 'two' as any , 'three' as any , 'four' as any , 'five' as any ) ;
63
- expect ( plotly . newPlot ) . toHaveBeenCalledWith ( 'one' , { data : 'two' , layout : 'three' , config : 'four' , frames : 'five' } ) ;
64
- resolve ( ) ;
65
- } ) ;
66
- } ) ) ;
67
-
68
- it ( 'should call plotly.plot method' , inject ( [ PlotlyService ] , async ( service : PlotlyService ) => {
69
- const plotly = await service . getPlotly ( ) ;
70
-
71
- spyOn ( plotly , 'newPlot' ) . and . returnValue ( new Promise ( ( ) => { } ) ) ;
72
- service . plot ( 'one' as any , 'two' as any , 'three' as any , 'four' as any ) ;
73
- expect ( plotly . newPlot ) . toHaveBeenCalledWith ( 'one' , 'two' , 'three' , 'four' ) ;
74
-
75
- service . plot ( 'one' as any , 'two' as any , 'three' as any , 'four' as any , 'five' as any ) ;
76
- expect ( plotly . newPlot ) . toHaveBeenCalledWith ( 'one' , { data : 'two' , layout : 'three' , config : 'four' , frames : 'five' } ) ;
77
- } ) ) ;
78
-
79
- it ( 'should call plotly.update method' , inject ( [ PlotlyService ] , async ( service : PlotlyService ) => {
80
- const plotly = await service . getPlotly ( ) ;
81
-
82
- spyOn ( plotly , 'react' ) . and . returnValue ( new Promise ( ( ) => { } ) ) ;
83
- service . update ( 'one' as any , 'two' as any , 'three' as any , 'four' as any ) ;
84
- expect ( plotly . react ) . toHaveBeenCalledWith ( 'one' , 'two' , 'three' , 'four' ) ;
85
-
86
- service . update ( 'one' as any , 'two' as any , 'three' as any , 'four' as any , 'five' as any ) ;
87
- expect ( plotly . react ) . toHaveBeenCalledWith ( 'one' , { data : 'two' , layout : 'three' , config : 'four' , frames : 'five' } ) ;
88
- } ) ) ;
89
51
90
52
it ( 'should call plotly.Plots.resize method' , inject ( [ PlotlyService ] , async ( service : PlotlyService ) => {
91
53
const plotly = await service . getPlotly ( ) ;
0 commit comments