@@ -28,6 +28,10 @@ describe('Test scatterpolar trace defaults:', function() {
28
28
expect ( traceOut . r ) . toEqual ( [ 1 , 2 , 3 , 4 , 5 ] ) ;
29
29
expect ( traceOut . theta ) . toEqual ( [ 1 , 2 , 3 ] ) ;
30
30
expect ( traceOut . _length ) . toBe ( 3 ) ;
31
+ expect ( traceOut . r0 ) . toBeUndefined ( ) ;
32
+ expect ( traceOut . dr ) . toBeUndefined ( ) ;
33
+ expect ( traceOut . theta0 ) . toBeUndefined ( ) ;
34
+ expect ( traceOut . dtheta ) . toBeUndefined ( ) ;
31
35
} ) ;
32
36
33
37
it ( 'should not truncate *theta* when longer than *r*' , function ( ) {
@@ -40,6 +44,39 @@ describe('Test scatterpolar trace defaults:', function() {
40
44
expect ( traceOut . r ) . toEqual ( [ 1 , 2 , 3 ] ) ;
41
45
expect ( traceOut . theta ) . toEqual ( [ 1 , 2 , 3 , 4 , 5 ] ) ;
42
46
expect ( traceOut . _length ) . toBe ( 3 ) ;
47
+ expect ( traceOut . r0 ) . toBeUndefined ( ) ;
48
+ expect ( traceOut . dr ) . toBeUndefined ( ) ;
49
+ expect ( traceOut . theta0 ) . toBeUndefined ( ) ;
50
+ expect ( traceOut . dtheta ) . toBeUndefined ( ) ;
51
+ } ) ;
52
+
53
+ it ( 'should coerce *theta0* and *dtheta* when *theta* is not set' , function ( ) {
54
+ _supply ( {
55
+ r : [ 1 , 2 , 3 ]
56
+ } ) ;
57
+
58
+ expect ( traceOut . r ) . toEqual ( [ 1 , 2 , 3 ] ) ;
59
+ expect ( traceOut . theta ) . toBeUndefined ( ) ;
60
+ expect ( traceOut . _length ) . toBe ( 3 ) ;
61
+ expect ( traceOut . r0 ) . toBeUndefined ( ) ;
62
+ expect ( traceOut . dr ) . toBeUndefined ( ) ;
63
+ expect ( traceOut . theta0 ) . toBe ( 0 ) ;
64
+ // its default value is computed later
65
+ expect ( traceOut . dtheta ) . toBeUndefined ( ) ;
66
+ } ) ;
67
+
68
+ it ( 'should coerce *r0* and *dr* when *r* is not set' , function ( ) {
69
+ _supply ( {
70
+ theta : [ 1 , 2 , 3 , 4 , 5 ]
71
+ } ) ;
72
+
73
+ expect ( traceOut . r ) . toBeUndefined ( ) ;
74
+ expect ( traceOut . theta ) . toEqual ( [ 1 , 2 , 3 , 4 , 5 ] ) ;
75
+ expect ( traceOut . _length ) . toBe ( 5 ) ;
76
+ expect ( traceOut . r0 ) . toBe ( 0 ) ;
77
+ expect ( traceOut . dr ) . toBe ( 1 ) ;
78
+ expect ( traceOut . theta0 ) . toBeUndefined ( ) ;
79
+ expect ( traceOut . dtheta ) . toBeUndefined ( ) ;
43
80
} ) ;
44
81
} ) ;
45
82
0 commit comments