@@ -13,25 +13,27 @@ describe('Bundle with finance trace type', function() {
13
13
14
14
var mock = require ( '@mocks/finance_style.json' ) ;
15
15
16
- it ( 'should register the correct trace modules for the generated traces ' , function ( ) {
16
+ it ( 'should not register transforms anymore ' , function ( ) {
17
17
var transformModules = Object . keys ( Plotly . Plots . transformsRegistry ) ;
18
18
19
- expect ( transformModules ) . toEqual ( [ 'ohlc' , 'candlestick' ] ) ;
19
+ expect ( transformModules ) . toEqual ( [ ] ) ;
20
20
} ) ;
21
21
22
22
it ( 'should register the correct trace modules for the generated traces' , function ( ) {
23
23
var traceModules = Object . keys ( Plotly . Plots . modules ) ;
24
24
25
- expect ( traceModules ) . toEqual ( [ 'scatter' , 'box' , 'ohlc' , 'candlestick' ] ) ;
25
+ // scatter is registered no matter what
26
+ // ohlc uses some parts of box by direct require but does not need to register it.
27
+ expect ( traceModules ) . toEqual ( [ 'scatter' , 'ohlc' , 'candlestick' ] ) ;
26
28
} ) ;
27
29
28
30
it ( 'should graph ohlc and candlestick traces' , function ( done ) {
29
31
30
32
Plotly . plot ( createGraphDiv ( ) , mock . data , mock . layout ) . then ( function ( ) {
31
33
var gSubplot = d3 . select ( 'g.cartesianlayer' ) ;
32
34
33
- expect ( gSubplot . selectAll ( 'g.trace.scatter ' ) . size ( ) ) . toEqual ( 2 ) ;
34
- expect ( gSubplot . selectAll ( 'g.trace.boxes' ) . size ( ) ) . toEqual ( 2 ) ;
35
+ expect ( gSubplot . selectAll ( 'g.trace.ohlc ' ) . size ( ) ) . toEqual ( 1 ) ;
36
+ expect ( gSubplot . selectAll ( 'g.trace.boxes' ) . size ( ) ) . toEqual ( 1 ) ;
35
37
36
38
destroyGraphDiv ( ) ;
37
39
done ( ) ;
0 commit comments