Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita383dc4

Browse files
committed
Improving code coverage
1 parent319415b commita383dc4

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+
constplotly=service.getPlotly();
3637
constmethods:(keyofPlotlyService)[]=['plot','update','newPlot'];
3738
methods.forEach(methodName=>{
38-
spyOn(service,methodName);
39+
spyOn(plotly,methodName);
3940

4041
(serviceasany)[methodName]('one'asany,'two'asany,'three'asany,'four'asany);
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'asany);
46-
expect(service.getPlotly().Plots.resize).toHaveBeenCalledWith('one');
47+
expect(plotly.Plots.resize).toHaveBeenCalledWith('one');
4748
}));
4849

4950

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp