@@ -1187,7 +1187,7 @@ describe('Test sunburst tweening:', function() {
1187
1187
return s . replace ( / \s / g, '' ) ;
1188
1188
}
1189
1189
1190
- function _assert ( msg , attrName , id , exp ) {
1190
+ function _assert ( msg , attrName , id , exp , tolerance ) {
1191
1191
var lookup = { d : pathTweenFnLookup , transform : textTweenFnLookup } [ attrName ] ;
1192
1192
var fn = lookup [ id ] ;
1193
1193
// normalize time in [0, 1] where we'll assert the tweening fn output,
@@ -1199,7 +1199,7 @@ describe('Test sunburst tweening:', function() {
1199
1199
if ( attrName === 'transform' ) {
1200
1200
var fake = { attr : function ( ) { return actual ; } } ;
1201
1201
var xy = Drawing . getTranslate ( fake ) ;
1202
- expect ( [ xy . x , xy . y ] ) . toBeWithinArray ( exp , 2 , msg2 ) ;
1202
+ expect ( [ xy . x , xy . y ] ) . toBeWithinArray ( exp , tolerance || 2 , msg2 ) ;
1203
1203
} else {
1204
1204
// we could maybe to bring in:
1205
1205
// https://github.com/hughsk/svg-path-parser
@@ -1388,10 +1388,10 @@ describe('Test sunburst tweening:', function() {
1388
1388
. then ( _run ( gd , 4 ) )
1389
1389
. then ( function ( ) {
1390
1390
_assert ( 'move J text to new position' , 'transform' , 'J' , [ 309.3085305481173 , 202.66937078300114 ] ) ;
1391
- _assert ( 'move O text to new position' , 'transform' , 'O' , [ 337.158534264498 , 162.57550532369754 ] ) ;
1391
+ _assert ( 'move O text to new position' , 'transform' , 'O' , [ 337.158534264498 , 162.57550532369754 ] , 5 ) ;
1392
1392
_assert ( 'move U text to new position' , 'transform' , 'U' , [ 416.1153793700712 , 163.4078137147134 ] ) ;
1393
1393
_assert ( 'move V text to new position' , 'transform' , 'V' , [ 471.63745793297295 , 218.00377184475153 ] ) ;
1394
- _assert ( 'move W text to new position' , 'transform' , 'W' , [ 455.10235209157037 , 177.717459723826 ] ) ;
1394
+ _assert ( 'move W text to new position' , 'transform' , 'W' , [ 455.10235209157037 , 177.717459723826 ] , 5 ) ;
1395
1395
_assert ( 'move X text to new position' , 'transform' , 'X' , [ 431.0320488371527 , 145.88885474402548 ] ) ;
1396
1396
_assert ( 'move Y text to new position' , 'transform' , 'Y' , [ 395.12660928295867 , 124.11350635624726 ] ) ;
1397
1397
_assert ( 'move Z text to new position' , 'transform' , 'Z' , [ 354.1550374068844 , 115.63596810986363 ] ) ;
@@ -1514,7 +1514,7 @@ describe('Test sunburst tweening:', function() {
1514
1514
. then ( function ( ) {
1515
1515
_assert ( 'move U text to new position' , 'transform' , 'U' , [ 313.79288001914836 , 202.45694251914836 ] ) ;
1516
1516
_assert ( 'move V text to new position' , 'transform' , 'V' , [ 441.011030377721 , 188.63633201157208 ] ) ;
1517
- _assert ( 'move W text to new position' , 'transform' , 'W' , [ 382.1346244328249 , 135.0126788235936 ] ) ;
1517
+ _assert ( 'move W text to new position' , 'transform' , 'W' , [ 382.1346244328249 , 135.0126788235936 ] , 5 ) ;
1518
1518
_assert ( 'move X text to new position' , 'transform' , 'X' , [ 277.7815763779703 , 162.7705278345142 ] ) ;
1519
1519
_assert ( 'move Y text to new position' , 'transform' , 'Y' , [ 249.73412124927503 , 271.78420776316403 ] ) ;
1520
1520
_assert ( 'move Z text to new position' , 'transform' , 'Z' , [ 305.39156336654094 , 331.3597434293286 ] ) ;
0 commit comments