Skip to content

Commit e98bc68

Browse files
committed
Adding tests for plotly.module
1 parent 3bdc292 commit e98bc68

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/app/plotly/plotly.module.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { PlotlyModule } from "./plotly.module";
2+
3+
4+
5+
describe('PlotlyModule', () => {
6+
7+
it('should create', () => {
8+
const fn = () => {
9+
const mod = new PlotlyModule();
10+
};
11+
12+
const msg = "Invalid PlotlyJS object. Please check https://github.com/plotly/angular-plotly.js#quick-start"
13+
+ " to see how to add PlotlyJS to your project.";
14+
expect(fn).toThrowError(msg);
15+
16+
17+
const fn2 = () => {
18+
PlotlyModule.plotlyjs = {plot: function() { }};
19+
const mod = new PlotlyModule();
20+
};
21+
22+
expect(fn2).not.toThrowError(msg);
23+
});
24+
25+
});

0 commit comments

Comments
 (0)