@@ -1705,6 +1705,36 @@ QUnit.test('Non-circle to circle', function(assert) {
17051705 assert . deepEqual ( point . graphic . stub ( 'append' ) . lastCall . args [ 0 ] , this . group ) ;
17061706} ) ;
17071707
1708+ QUnit . test ( 'Point should be changed to a circle if updateOption() arises several times before redraw (T1284076)' , function ( assert ) {
1709+ this . options . symbol = 'square' ;
1710+ const point = createPoint ( this . series , { argument : 1 , value : 1 } , this . options ) ;
1711+
1712+ point . translate ( ) ;
1713+ point . draw ( this . renderer , this . groups ) ;
1714+
1715+ const newOptions = $ . extend ( true , { } , this . options , { symbol : 'circle' } ) ;
1716+ point . updateOptions ( newOptions ) ;
1717+ point . updateOptions ( newOptions ) ;
1718+ point . translate ( ) ;
1719+ point . draw ( this . renderer , this . groups ) ;
1720+
1721+ assert . ok ( point . graphic ) ;
1722+ assert . equal ( point . graphic . typeOfNode , 'circle' ) ;
1723+
1724+ assert . equal ( this . renderer . stub ( 'path' ) . callCount , 1 ) ;
1725+ assert . deepEqual ( this . renderer . stub ( 'path' ) . firstCall . args [ 0 ] , [ ] ) ;
1726+ assert . deepEqual ( this . renderer . stub ( 'path' ) . firstCall . args [ 1 ] , 'area' ) ;
1727+
1728+ assert . equal ( this . renderer . stub ( 'circle' ) . callCount , 1 ) ;
1729+ assert . deepEqual ( this . renderer . stub ( 'circle' ) . firstCall . args , [ ] ) ;
1730+ assert . equal ( point . graphic . stub ( 'attr' ) . lastCall . args [ 0 ] . translateX , 11 ) ;
1731+ assert . equal ( point . graphic . stub ( 'attr' ) . lastCall . args [ 0 ] . translateY , 22 ) ;
1732+ assert . equal ( point . graphic . stub ( 'attr' ) . lastCall . args [ 0 ] . r , 6 ) ;
1733+ assert . equal ( point . graphic , this . renderer . stub ( 'circle' ) . firstCall . returnValue ) ;
1734+
1735+ assert . deepEqual ( point . graphic . stub ( 'append' ) . lastCall . args [ 0 ] , this . group ) ;
1736+ } ) ;
1737+
17081738QUnit . test ( 'Non-image to image (image option is string)' , function ( assert ) {
17091739 this . options . symbol = 'circle' ;
17101740 const point = createPoint ( this . series , { argument : 1 , value : 1 } , this . options ) ;
0 commit comments