Skip to content

Commit a383dc4

Browse files
committed
Improving code coverage
1 parent 319415b commit a383dc4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/app/plotly/plotly.service.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,18 @@ describe('PlotlyService', () => {
3333
}));
3434

3535
it('should call plotly methods', inject([PlotlyService], (service: PlotlyService) => {
36+
const plotly = service.getPlotly();
3637
const methods: (keyof PlotlyService)[] = ['plot', 'update', 'newPlot'];
3738
methods.forEach(methodName => {
38-
spyOn(service, methodName);
39+
spyOn(plotly, methodName);
3940

4041
(service as any)[methodName]('one' as any, 'two' as any, 'three' as any, 'four' as any);
41-
expect(service[methodName]).toHaveBeenCalledWith('one', 'two', 'three', 'four');
42+
expect(plotly[methodName]).toHaveBeenCalledWith('one', 'two', 'three', 'four');
4243
});
4344

44-
spyOn(service.getPlotly().Plots, 'resize');
45+
spyOn(plotly.Plots, 'resize');
4546
service.resize('one' as any);
46-
expect(service.getPlotly().Plots.resize).toHaveBeenCalledWith('one');
47+
expect(plotly.Plots.resize).toHaveBeenCalledWith('one');
4748
}));
4849

4950

0 commit comments

Comments
 (0)