@@ -49,14 +49,14 @@ exports.assertStyle = function(dims, color, opacity) {
4949exports . assertHoverLabelStyle = function ( g , expectation , msg , textSelector ) {
5050 if ( ! msg ) msg = '' ;
5151
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' ) ;
6060} ;
6161
6262exports . assertClip = function ( sel , isClipped , size , msg ) {
0 commit comments