@@ -75,28 +75,33 @@ describe('Test shapes:', function() {
7575
7676 describe ( 'Plotly.relayout' , function ( ) {
7777 it ( 'should be able to add a shape' , function ( done ) {
78+ var pathCount = countShapePaths ( ) ;
7879 var index = countShapes ( gd ) ;
7980 var shape = getRandomShape ( ) ;
8081
8182 Plotly . relayout ( gd , 'shapes[' + index + ']' , shape ) . then ( function ( ) {
8283 expect ( countShapeLayers ( ) ) . toEqual ( 1 ) ;
84+ expect ( countShapePaths ( ) ) . toEqual ( pathCount + 1 ) ;
8385 expect ( getLastShape ( gd ) ) . toEqual ( shape ) ;
8486 expect ( countShapes ( gd ) ) . toEqual ( index + 1 ) ;
8587 } ) . then ( done ) ;
8688 } ) ;
8789
8890 it ( 'should be able to remove a shape' , function ( done ) {
91+ var pathCount = countShapePaths ( ) ;
8992 var index = countShapes ( gd ) ;
9093 var shape = getRandomShape ( ) ;
9194
9295 Plotly . relayout ( gd , 'shapes[' + index + ']' , shape ) . then ( function ( ) {
9396 expect ( countShapeLayers ( ) ) . toEqual ( 1 ) ;
97+ expect ( countShapePaths ( ) ) . toEqual ( pathCount + 1 ) ;
9498 expect ( getLastShape ( gd ) ) . toEqual ( shape ) ;
9599 expect ( countShapes ( gd ) ) . toEqual ( index + 1 ) ;
96100 } ) . then ( function ( ) {
97101 Plotly . relayout ( gd , 'shapes[' + index + ']' , 'remove' ) ;
98102 } ) . then ( function ( ) {
99103 expect ( countShapeLayers ( ) ) . toEqual ( 1 ) ;
104+ expect ( countShapePaths ( ) ) . toEqual ( pathCount ) ;
100105 expect ( countShapes ( gd ) ) . toEqual ( index ) ;
101106 } ) . then ( done ) ;
102107 } ) ;
0 commit comments