@@ -983,6 +983,37 @@ describe('finance charts updates:', function() {
983
983
. then ( done ) ;
984
984
} ) ;
985
985
986
+ it ( 'should work with typed array' , function ( done ) {
987
+ var mockTA = {
988
+ open : new Float32Array ( mock0 . open ) ,
989
+ high : new Float32Array ( mock0 . high ) ,
990
+ low : new Float32Array ( mock0 . low ) ,
991
+ close : new Float32Array ( mock0 . close )
992
+ } ;
993
+
994
+ var dataTA = [
995
+ Lib . extendDeep ( { } , mockTA , { type : 'ohlc' } ) ,
996
+ Lib . extendDeep ( { } , mockTA , { type : 'candlestick' } ) ,
997
+ ] ;
998
+
999
+ var data0 = [
1000
+ Lib . extendDeep ( { } , mock0 , { type : 'ohlc' } ) ,
1001
+ Lib . extendDeep ( { } , mock0 , { type : 'candlestick' } ) ,
1002
+ ] ;
1003
+
1004
+ Plotly . plot ( gd , dataTA )
1005
+ . then ( function ( ) {
1006
+ expect ( countOHLCTraces ( ) ) . toBe ( 1 , '# of ohlc traces' ) ;
1007
+ expect ( countBoxTraces ( ) ) . toBe ( 1 , '# of candlestick traces' ) ;
1008
+ } )
1009
+ . then ( function ( ) { return Plotly . react ( gd , data0 ) ; } )
1010
+ . then ( function ( ) {
1011
+ expect ( countOHLCTraces ( ) ) . toBe ( 1 , '# of ohlc traces' ) ;
1012
+ expect ( countBoxTraces ( ) ) . toBe ( 1 , '# of candlestick traces' ) ;
1013
+ } )
1014
+ . catch ( failTest )
1015
+ . then ( done ) ;
1016
+ } ) ;
986
1017
} ) ;
987
1018
988
1019
describe ( 'finance charts *special* handlers:' , function ( ) {
0 commit comments