@@ -49,14 +49,14 @@ exports.assertStyle = function(dims, color, opacity) {
49
49
exports . assertHoverLabelStyle = function ( g , expectation , msg , textSelector ) {
50
50
if ( ! msg ) msg = '' ;
51
51
52
- var path = g . select ( 'path' ) . node ( ) ;
53
- expect ( getComputedStyle ( path ) . fill ) . toBe ( expectation . bgcolor , msg + ': bgcolor' ) ;
54
- expect ( getComputedStyle ( path ) . stroke ) . toBe ( expectation . bordercolor , msg + ': bordercolor' ) ;
55
-
56
- var text = g . select ( textSelector || 'text.nums' ) . node ( ) ;
57
- expect ( getComputedStyle ( text ) . fontFamily . split ( ',' ) [ 0 ] ) . toBe ( expectation . fontFamily , msg + ': font.family' ) ;
58
- expect ( parseInt ( getComputedStyle ( text ) . fontSize ) ) . toBe ( expectation . fontSize , msg + ': font.size' ) ;
59
- expect ( getComputedStyle ( text ) . fill ) . toBe ( expectation . fontColor , msg + ': font.color' ) ;
52
+ var pathStyle = window . getComputedStyle ( g . select ( 'path' ) . node ( ) ) ;
53
+ expect ( pathStyle . fill ) . toBe ( expectation . bgcolor , msg + ': bgcolor' ) ;
54
+ expect ( pathStyle . stroke ) . toBe ( expectation . bordercolor , msg + ': bordercolor' ) ;
55
+
56
+ var textStyle = window . getComputedStyle ( g . select ( textSelector || 'text.nums' ) . node ( ) ) ;
57
+ expect ( textStyle . fontFamily . split ( ',' ) [ 0 ] ) . toBe ( expectation . fontFamily , msg + ': font.family' ) ;
58
+ expect ( parseInt ( textStyle . fontSize ) ) . toBe ( expectation . fontSize , msg + ': font.size' ) ;
59
+ expect ( textStyle . fill ) . toBe ( expectation . fontColor , msg + ': font.color' ) ;
60
60
} ;
61
61
62
62
exports . assertClip = function ( sel , isClipped , size , msg ) {
0 commit comments