Skip to content

Commit e892381

Browse files
committed
Adding quick test
1 parent 53c4ded commit e892381

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/shared/plot/plot.component.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ describe('PlotComponent', () => {
141141
}, 13);
142142
});
143143

144+
it('should fail when plotlyInstance is undefined', () => {
145+
component.plotlyInstance = undefined;
146+
147+
const error = new Error(`Plotly component wasn't initialized`);
148+
const fn = () => {
149+
component.updatePlot();
150+
};
151+
152+
expect(fn).toThrow(error);
153+
});
154+
144155
it('should add handler into window.resize when useResizeHandler=true', () => {
145156
spyOn(component, 'getWindow').and.callFake(() => windowSpy);
146157

0 commit comments

Comments
 (0)