File tree 2 files changed +3
-5
lines changed
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,7 @@ describe('dc.legend', () => {
53
53
expect ( chart . selectAll ( 'g.dc-legend g.dc-legend-item text' ) . size ( ) ) . toBe ( 3 ) ;
54
54
} ) ;
55
55
56
- // The following test has started failing on Chrome Headless 96.0.4664.110
57
- xit ( 'should position the legend labels' , ( ) => {
56
+ it ( 'should position the legend labels' , ( ) => {
58
57
expect ( legendLabel ( 0 ) . attr ( 'x' ) ) . toBeWithinDelta ( 15 , 2 ) ;
59
58
expect ( legendLabel ( 0 ) . attr ( 'y' ) ) . toBeWithinDelta ( 11.75 , 2 ) ;
60
59
expect ( legendLabel ( 1 ) . attr ( 'x' ) ) . toBeWithinDelta ( 15 , 2 ) ;
Original file line number Diff line number Diff line change @@ -289,9 +289,8 @@ export class Legend {
289
289
. text ( self . _legendText )
290
290
. attr ( 'x' , self . _itemHeight + LABEL_GAP )
291
291
. attr ( 'y' , function ( ) {
292
- return (
293
- self . _itemHeight / 2 + ( this . clientHeight ? this . clientHeight : 13 ) / 2 - 2
294
- ) ;
292
+ const clientHeight = this . getBoundingClientRect ( ) . height || 13 ;
293
+ return self . _itemHeight / 2 + clientHeight / 2 - 2 ;
295
294
} ) ;
296
295
}
297
296
You can’t perform that action at this time.
0 commit comments