@@ -64,6 +64,33 @@ describe('Test Plots', function() {
64
64
expect ( gd . _fullLayout . yaxis . _m )
65
65
. not . toBe ( oldFullLayout . yaxis . _m , '(set during ax.setScale' ) ;
66
66
} ) ;
67
+
68
+ it ( 'should include the correct reference to user data' , function ( ) {
69
+ var trace0 = { y : [ 1 , 2 , 3 ] } ;
70
+ var trace1 = { y : [ 5 , 2 , 3 ] } ;
71
+
72
+ var data = [ trace0 , trace1 ] ;
73
+ var gd = { data : data } ;
74
+
75
+ Plots . supplyDefaults ( gd ) ;
76
+
77
+ expect ( gd . data ) . toBe ( data ) ;
78
+
79
+ expect ( gd . _fullData [ 0 ] . index ) . toEqual ( 0 ) ;
80
+ expect ( gd . _fullData [ 1 ] . index ) . toEqual ( 1 ) ;
81
+
82
+ expect ( gd . _fullData [ 0 ] . _expandedIndex ) . toEqual ( 0 ) ;
83
+ expect ( gd . _fullData [ 1 ] . _expandedIndex ) . toEqual ( 1 ) ;
84
+
85
+ expect ( gd . _fullData [ 0 ] . _input ) . toBe ( trace0 ) ;
86
+ expect ( gd . _fullData [ 1 ] . _input ) . toBe ( trace1 ) ;
87
+
88
+ expect ( gd . _fullData [ 0 ] . _fullInput ) . toBe ( gd . _fullData [ 0 ] ) ;
89
+ expect ( gd . _fullData [ 1 ] . _fullInput ) . toBe ( gd . _fullData [ 1 ] ) ;
90
+
91
+ expect ( gd . _fullData [ 0 ] . _expandedInput ) . toBe ( gd . _fullData [ 0 ] ) ;
92
+ expect ( gd . _fullData [ 1 ] . _expandedInput ) . toBe ( gd . _fullData [ 1 ] ) ;
93
+ } ) ;
67
94
} ) ;
68
95
69
96
describe ( 'Plots.supplyLayoutGlobalDefaults should' , function ( ) {
0 commit comments