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

Commit59f1536

Browse files
committed
Improving tests for PlotlyViaCdnModule
1 parent04a1cd2 commit59f1536

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

‎devdocs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Update the version in package.json
44
* Update the version in projects/plotly/package.json
55
* Update the CHANGELOG.md
6-
*`ng test --codeCoverage=true --progress=true --watch=false`
6+
*`ng test --code-coverage=true --progress=true --watch=false`
77
*`cp README.md angular-plotly.png projects/plotly`
88
*`ng build plotly --configuration production`
99
*`git commit -am "<version>"`

‎projects/plotly/src/lib/plotly-via-cdn.module.spec.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,24 @@ describe('PlotlyViaCDNModule', () => {
3333
expect(fn).toThrowError(msg);
3434
});
3535

36+
describe(".setPlotlyVersion",()=>{
37+
it('should set Plotly version',()=>{
38+
constversion="latest";
39+
spyOn(PlotlyViaCDNModule,"loadViaCDN");
40+
41+
PlotlyViaCDNModule.setPlotlyVersion(version);
42+
43+
expect(PlotlyViaCDNModule.loadViaCDN).toHaveBeenCalled();
44+
expect((PlotlyViaCDNModuleasany).plotlyVersion).toBe(version);
45+
});
46+
47+
it('should NOT set Plotly version',()=>{
48+
constversion="invalid";
49+
spyOn(PlotlyViaCDNModule,"loadViaCDN").and.callThrough();
50+
51+
expect(()=>{
52+
PlotlyViaCDNModule.setPlotlyVersion(version);
53+
}).toThrowError("Invalid plotly version. Please set 'latest' or version number (i.e.: 1.4.3)");
54+
});
55+
});
3656
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp