@@ -220,6 +220,41 @@ describe('finance charts defaults:', function() {
220220 ] ) ;
221221 } ) ;
222222
223+ it ( 'trace-wide styling should set default for corresponding per-direction styling' , function ( ) {
224+ function assertLine ( cont , width , dash ) {
225+ expect ( cont . line . width ) . toEqual ( width ) ;
226+ if ( dash ) expect ( cont . line . dash ) . toEqual ( dash ) ;
227+ }
228+
229+ var trace0 = Lib . extendDeep ( { } , mock0 , {
230+ type : 'ohlc' ,
231+ line : { width : 1 , dash : 'dash' } ,
232+ decreasing : { line : { dash : 'dot' } }
233+ } ) ;
234+
235+ var trace1 = Lib . extendDeep ( { } , mock1 , {
236+ type : 'candlestick' ,
237+ line : { width : 3 } ,
238+ increasing : { line : { width : 0 } }
239+ } ) ;
240+
241+ var out = _supply ( [ trace0 , trace1 ] ) ;
242+
243+
244+ var fullData = out . _fullData ;
245+ var fullInput = fullData . map ( function ( fullTrace ) { return fullTrace . _fullInput ; } ) ;
246+
247+ assertLine ( fullInput [ 0 ] . increasing , 1 , 'dash' ) ;
248+ assertLine ( fullInput [ 0 ] . decreasing , 1 , 'dot' ) ;
249+ assertLine ( fullInput [ 2 ] . increasing , 0 ) ;
250+ assertLine ( fullInput [ 2 ] . decreasing , 3 ) ;
251+
252+ assertLine ( fullData [ 0 ] , 1 , 'dash' ) ;
253+ assertLine ( fullData [ 1 ] , 1 , 'dot' ) ;
254+ assertLine ( fullData [ 2 ] , 0 ) ;
255+ assertLine ( fullData [ 3 ] , 3 ) ;
256+ } ) ;
257+
223258 it ( 'trace-wide *visible* should be passed to generated traces' , function ( ) {
224259 var trace0 = Lib . extendDeep ( { } , mock0 , {
225260 type : 'ohlc' ,
0 commit comments