@@ -75,11 +75,9 @@ describe("dc.heatmap", function() {
75
75
} ) ;
76
76
77
77
it ( 'should position the y-axis labels with their associated rows' , function ( ) {
78
- var yaxisTexts = chart . selectAll ( ".rows.axis text" ) ;
79
- expect ( + yaxisTexts [ 0 ] [ 0 ] . getAttribute ( "y" ) ) . toEqual ( 150 ) ;
80
- expect ( + yaxisTexts [ 0 ] [ 0 ] . getAttribute ( "x" ) ) . toEqual ( 0 ) ;
81
- expect ( + yaxisTexts [ 0 ] [ 1 ] . getAttribute ( "y" ) ) . toEqual ( 50 ) ;
82
- expect ( + yaxisTexts [ 0 ] [ 1 ] . getAttribute ( "x" ) ) . toEqual ( 0 ) ;
78
+ var yaxisTicks = chart . selectAll ( ".rows.axis .tick" ) ;
79
+ expect ( yaxisTicks [ 0 ] [ 0 ] . getAttribute ( "transform" ) ) . toEqual ( "translate(0,150)" ) ;
80
+ expect ( yaxisTicks [ 0 ] [ 1 ] . getAttribute ( "transform" ) ) . toEqual ( "translate(0,50)" ) ;
83
81
} ) ;
84
82
85
83
it ( 'should have labels on the y-axis corresponding to the row values' , function ( ) {
@@ -89,11 +87,9 @@ describe("dc.heatmap", function() {
89
87
} ) ;
90
88
91
89
it ( 'should position the x-axis labels with their associated columns' , function ( ) {
92
- var xaxisTexts = chart . selectAll ( ".cols.axis text" ) ;
93
- expect ( + xaxisTexts [ 0 ] [ 0 ] . getAttribute ( "y" ) ) . toEqual ( 200 ) ;
94
- expect ( + xaxisTexts [ 0 ] [ 0 ] . getAttribute ( "x" ) ) . toEqual ( 50 ) ;
95
- expect ( + xaxisTexts [ 0 ] [ 1 ] . getAttribute ( "y" ) ) . toEqual ( 200 ) ;
96
- expect ( + xaxisTexts [ 0 ] [ 1 ] . getAttribute ( "x" ) ) . toEqual ( 150 ) ;
90
+ var xaxisTexts = chart . selectAll ( ".cols.axis .tick" ) ;
91
+ expect ( xaxisTexts [ 0 ] [ 0 ] . getAttribute ( "transform" ) ) . toEqual ( "translate(50,0)" ) ;
92
+ expect ( xaxisTexts [ 0 ] [ 1 ] . getAttribute ( "transform" ) ) . toEqual ( "translate(150,0)" ) ;
97
93
} ) ;
98
94
99
95
it ( 'should have labels on the x-axis corresponding to the row values' , function ( ) {
@@ -344,13 +340,13 @@ describe("dc.heatmap", function() {
344
340
describe ( 'on axis labels' , function ( ) {
345
341
describe ( 'with nothing previously filtered' , function ( ) {
346
342
it ( 'should filter all cells on that axis' , function ( ) {
347
- chart . selectAll ( ".cols.axis text " ) . each ( function ( d ) {
343
+ chart . selectAll ( ".cols.axis g " ) . each ( function ( d ) {
348
344
var axisLabel = d3 . select ( this ) ;
349
345
axisLabel . on ( "click" ) ( d ) ;
350
346
assertOnlyThisAxisIsFiltered ( chart , 0 , d ) ;
351
347
axisLabel . on ( "click" ) ( d ) ;
352
348
} ) ;
353
- chart . selectAll ( ".rows.axis text " ) . each ( function ( d ) {
349
+ chart . selectAll ( ".rows.axis g " ) . each ( function ( d ) {
354
350
var axisLabel = d3 . select ( this ) ;
355
351
axisLabel . on ( "click" ) ( d ) ;
356
352
assertOnlyThisAxisIsFiltered ( chart , 1 , d ) ;
@@ -369,7 +365,7 @@ describe("dc.heatmap", function() {
369
365
370
366
var xVal = box . datum ( ) . key [ 0 ] ;
371
367
372
- var columns = chart . selectAll ( ".cols.axis text " ) ;
368
+ var columns = chart . selectAll ( ".cols.axis g " ) ;
373
369
var column = columns . filter ( function ( columnData ) {
374
370
return columnData == xVal ;
375
371
} ) ;
@@ -393,7 +389,7 @@ describe("dc.heatmap", function() {
393
389
394
390
assertOnlyThisAxisIsFiltered ( chart , 0 , xVal ) ;
395
391
396
- var columns = chart . selectAll ( ".cols.axis text " ) ;
392
+ var columns = chart . selectAll ( ".cols.axis g " ) ;
397
393
var column = columns . filter ( function ( columnData ) {
398
394
return columnData == xVal ;
399
395
} ) ;
0 commit comments