Skip to content

Commit d109205

Browse files
committed
Improving tests
1 parent 70f8eba commit d109205

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ describe('PlotlyService', () => {
4646
spyOn(plotly, 'newPlot').and.returnValue(Promise.resolve());
4747
await service.newPlot('one' as any, 'two' as any, 'three' as any, 'four' as any);
4848
expect(plotly.newPlot).toHaveBeenCalledWith('one', 'two', 'three', 'four');
49+
50+
await service.newPlot('one' as any, 'two' as any, 'three' as any, 'four' as any, 'five' as any);
51+
expect(plotly.newPlot).toHaveBeenCalledWith('one', {data: 'two', layout: 'three', config: 'four', frames: 'five'});
4952
resolve();
5053
});
5154
}));
@@ -56,6 +59,9 @@ describe('PlotlyService', () => {
5659
spyOn(plotly, 'plot').and.returnValue(new Promise(() => {}));
5760
service.plot('one' as any, 'two' as any, 'three' as any, 'four' as any);
5861
expect(plotly.plot).toHaveBeenCalledWith('one', 'two', 'three', 'four');
62+
63+
service.plot('one' as any, 'two' as any, 'three' as any, 'four' as any, 'five' as any);
64+
expect(plotly.plot).toHaveBeenCalledWith('one', {data: 'two', layout: 'three', config: 'four', frames: 'five'});
5965
}));
6066

6167
it('should call plotly.update method', inject([PlotlyService], (service: PlotlyService) => {
@@ -64,6 +70,9 @@ describe('PlotlyService', () => {
6470
spyOn(plotly, 'react').and.returnValue(new Promise(() => {}));
6571
service.update('one' as any, 'two' as any, 'three' as any, 'four' as any);
6672
expect(plotly.react).toHaveBeenCalledWith('one', 'two', 'three', 'four');
73+
74+
service.update('one' as any, 'two' as any, 'three' as any, 'four' as any, 'five' as any);
75+
expect(plotly.react).toHaveBeenCalledWith('one', {data: 'two', layout: 'three', config: 'four', frames: 'five'});
6776
}));
6877

6978
it('should call plotly.Plots.resize method', inject([PlotlyService], (service: PlotlyService) => {

0 commit comments

Comments
 (0)