@@ -822,8 +822,8 @@ describe('Logarithmic Scale tests', function() {
822
822
var start = chart . chartArea [ chartStart ] ;
823
823
var end = chart . chartArea [ chartEnd ] ;
824
824
825
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start ) ;
826
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
825
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
826
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
827
827
828
828
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( firstTick , 4 ) ;
829
829
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
@@ -835,8 +835,8 @@ describe('Logarithmic Scale tests', function() {
835
835
start = chart . chartArea [ chartEnd ] ;
836
836
end = chart . chartArea [ chartStart ] ;
837
837
838
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start ) ;
839
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
838
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
839
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
840
840
841
841
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( firstTick , 4 ) ;
842
842
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
@@ -964,9 +964,9 @@ describe('Logarithmic Scale tests', function() {
964
964
var start = chart . chartArea [ axis . start ] ;
965
965
var end = chart . chartArea [ axis . end ] ;
966
966
967
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start ) ;
968
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
969
- expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBe ( start ) ; // 0 is invalid, put it at the start.
967
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
968
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
969
+ expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBeCloseToPixel ( start ) ; // 0 is invalid, put it at the start.
970
970
971
971
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( firstTick , 4 ) ;
972
972
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
@@ -978,8 +978,8 @@ describe('Logarithmic Scale tests', function() {
978
978
start = chart . chartArea [ axis . end ] ;
979
979
end = chart . chartArea [ axis . start ] ;
980
980
981
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start ) ;
982
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
981
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
982
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
983
983
984
984
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( firstTick , 4 ) ;
985
985
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
@@ -1093,9 +1093,9 @@ describe('Logarithmic Scale tests', function() {
1093
1093
var end = chart . chartArea [ axis . end ] ;
1094
1094
var sign = scale . isHorizontal ( ) ? 1 : - 1 ;
1095
1095
1096
- expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBe ( start ) ;
1097
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
1098
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start + sign * fontSize ) ;
1096
+ expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
1097
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
1098
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start + sign * fontSize ) ;
1099
1099
1100
1100
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( 0 , 4 ) ;
1101
1101
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
@@ -1108,9 +1108,9 @@ describe('Logarithmic Scale tests', function() {
1108
1108
start = chart . chartArea [ axis . end ] ;
1109
1109
end = chart . chartArea [ axis . start ] ;
1110
1110
1111
- expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBe ( start ) ;
1112
- expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBe ( end ) ;
1113
- expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBe ( start - sign * fontSize , 4 ) ;
1111
+ expect ( scale . getPixelForValue ( 0 , 0 , 0 ) ) . toBeCloseToPixel ( start ) ;
1112
+ expect ( scale . getPixelForValue ( lastTick , 0 , 0 ) ) . toBeCloseToPixel ( end ) ;
1113
+ expect ( scale . getPixelForValue ( firstTick , 0 , 0 ) ) . toBeCloseToPixel ( start - sign * fontSize , 4 ) ;
1114
1114
1115
1115
expect ( scale . getValueForPixel ( start ) ) . toBeCloseTo ( 0 , 4 ) ;
1116
1116
expect ( scale . getValueForPixel ( end ) ) . toBeCloseTo ( lastTick , 4 ) ;
0 commit comments