File tree 2 files changed +13
-22
lines changed
2 files changed +13
-22
lines changed Original file line number Diff line number Diff line change 1
1
/* global Plotly:false */
2
2
3
+ var MAPBOX_ACCESS_TOKEN = require ( '@build/credentials.json' ) . MAPBOX_ACCESS_TOKEN ;
4
+ var mockLists = require ( '../assets/mock_lists' ) ;
5
+
3
6
describe ( 'Test plotly.min.js' , function ( ) {
4
7
'use strict' ;
5
8
6
- // Note: this test doesn't have access to custom_matchers.js
7
- // so you can only use standard jasmine matchers here.
9
+ var gd = document . createElement ( 'div' ) ;
10
+ document . body . appendChild ( gd ) ;
8
11
9
12
it ( 'should expose Plotly global' , function ( ) {
10
13
expect ( window . Plotly ) . toBeDefined ( ) ;
11
14
} ) ;
12
15
13
- it ( 'should be able to plot a mapbox plot' , function ( done ) {
14
- var gd = document . createElement ( 'div' ) ;
15
- document . body . appendChild ( gd ) ;
16
+ Plotly . setPlotConfig ( {
17
+ mapboxAccessToken : MAPBOX_ACCESS_TOKEN
18
+ } ) ;
16
19
17
- Plotly . plot ( gd , [ {
18
- type : 'scattermapbox' ,
19
- lon : [ 10 , 20 , 30 ] ,
20
- lat : [ 10 , 30 , 20 ]
21
- } ] , { } , {
22
- mapboxAccessToken : 'pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ'
23
- } )
24
- . catch ( function ( ) {
25
- fail ( 'mapbox plot failed' ) ;
26
- } )
27
- . then ( function ( ) {
28
- document . body . removeChild ( gd ) ;
29
- done ( ) ;
20
+ mockLists . all . forEach ( function ( mockSpec ) {
21
+ it ( 'can plot "' + mockSpec [ 0 ] + '"' , function ( done ) {
22
+ Plotly . newPlot ( gd , mockSpec [ 1 ] ) . catch ( fail ) . then ( done ) ;
30
23
} ) ;
31
24
} ) ;
32
25
} ) ;
Original file line number Diff line number Diff line change @@ -256,10 +256,8 @@ if(isFullSuite) {
256
256
delete func . defaultConfig . preprocessors [ pathToCustomMatchers ] ;
257
257
break ;
258
258
case 'minified_bundle' :
259
- // browserified custom_matchers doesn't work with this route
260
- // so clear them out of the files and preprocessors
261
- func . defaultConfig . files = [ constants . pathToPlotlyDistMin ] ;
262
- delete func . defaultConfig . preprocessors [ pathToCustomMatchers ] ;
259
+ func . defaultConfig . files . push ( constants . pathToPlotlyDistMin ) ;
260
+ func . defaultConfig . preprocessors [ testFileGlob ] = [ 'browserify' ] ;
263
261
break ;
264
262
case 'ie9' :
265
263
// load ie9_mock.js before plotly.js+test bundle
You can’t perform that action at this time.
0 commit comments