@@ -111,6 +111,44 @@ describe('Test boxes supplyDefaults', function() {
111
111
expect ( traceOut . xcalendar ) . toBe ( 'coptic' ) ;
112
112
expect ( traceOut . ycalendar ) . toBe ( 'ethiopian' ) ;
113
113
} ) ;
114
+
115
+ it ( 'should not coerce point attributes when boxpoints is false' , function ( ) {
116
+ traceIn = {
117
+ y : [ 1 , 1 , 2 ] ,
118
+ boxpoints : false
119
+ } ;
120
+ supplyDefaults ( traceIn , traceOut , defaultColor , { } ) ;
121
+
122
+ expect ( traceOut . boxpoints ) . toBe ( false ) ;
123
+ expect ( traceOut . jitter ) . toBeUndefined ( ) ;
124
+ expect ( traceOut . pointpos ) . toBeUndefined ( ) ;
125
+ expect ( traceOut . marker ) . toBeUndefined ( ) ;
126
+ expect ( traceOut . text ) . toBeUndefined ( ) ;
127
+ } ) ;
128
+
129
+ it ( 'should default boxpoints to suspectedoutliers when marker.outliercolor is set & valid' , function ( ) {
130
+ traceIn = {
131
+ y : [ 1 , 1 , 2 ] ,
132
+ marker : {
133
+ outliercolor : 'blue'
134
+ }
135
+ } ;
136
+ supplyDefaults ( traceIn , traceOut , defaultColor , { } ) ;
137
+ expect ( traceOut . boxpoints ) . toBe ( 'suspectedoutliers' ) ;
138
+ } ) ;
139
+
140
+ it ( 'should default boxpoints to suspectedoutliers when marker.line.outliercolor is set & valid' , function ( ) {
141
+ traceIn = {
142
+ y : [ 1 , 1 , 2 ] ,
143
+ marker : {
144
+ line : { outliercolor : 'blue' }
145
+ }
146
+ } ;
147
+ supplyDefaults ( traceIn , traceOut , defaultColor , { } ) ;
148
+ expect ( traceOut . boxpoints ) . toBe ( 'suspectedoutliers' ) ;
149
+ expect ( traceOut . marker ) . toBeDefined ( ) ;
150
+ expect ( traceOut . text ) . toBeDefined ( ) ;
151
+ } ) ;
114
152
} ) ;
115
153
116
154
describe ( 'Test box hover:' , function ( ) {
0 commit comments