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

Commit02f6206

Browse files
committed
Fixing tests in several files
1 parent225533e commit02f6206

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import{PlotlyBundleName}from'dist/plotly/public-api';
2+
3+
import{PlotlyViaCDNModule}from'./plotly-via-cdn.module';
4+
import{PlotlyService}from'./plotly.service';
5+
6+
describe('PlotlyViaCDNModule',()=>{
7+
letplotlyServiceCache:any={};
8+
9+
beforeEach(()=>{
10+
plotlyServiceCache.moduleName=(PlotlyServiceasany).moduleName;
11+
});
12+
13+
afterEach(()=>{
14+
(PlotlyServiceasany).moduleName=plotlyServiceCache.moduleName;
15+
});
16+
17+
it('should create',()=>{
18+
constplotlyService=jasmine.createSpyObj('PlotlyService',['setModuleName']);
19+
const_=newPlotlyViaCDNModule(plotlyService);
20+
21+
expect((PlotlyServiceasany).moduleName).toBe('ViaCDN');
22+
});
23+
24+
it('should set Plotly Bundle',()=>{
25+
constvalidValues:any[]=['basic','cartesian','geo','gl3d','gl2d','mapbox','finance',null];
26+
for(constvalueofvalidValues){
27+
PlotlyViaCDNModule.setPlotlyBundle(value);
28+
expect((PlotlyViaCDNModuleasany).plotlyBundle).toBe(value);
29+
}
30+
31+
constfn=()=>(PlotlyViaCDNModuleasany).setPlotlyBundle('Invalid name');
32+
constmsg=`Invalid plotly bundle. Please set to null for full or "basic", "cartesian", "geo", "gl3d", "gl2d", "mapbox", "finance" for a partial bundle.`;
33+
expect(fn).toThrowError(msg);
34+
});
35+
36+
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class PlotlyViaCDNModule {
3333
PlotlyViaCDNModule.plotlyVersion=version;
3434
}
3535

36-
publicstaticsetPlotlyBundle(bundle:PlotlyBundleName):void{
36+
publicstaticsetPlotlyBundle(bundle:PlotlyBundleName|null):void{
3737
constisOk=bundle===null||PlotlyViaCDNModule.plotlyBundleNames.indexOf(bundle)>=0;
3838
if(!isOk){
3939
constnames=PlotlyViaCDNModule.plotlyBundleNames.map(n=>`"${n}"`).join(', ');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp