Skip to content

Commit e51e0df

Browse files
committed
fix for tspans differing on chrome vs firefox
1 parent 8e363e5 commit e51e0df

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/jasmine/tests/hover_label_test.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ describe('hover info', function() {
148148
expect(d3.selectAll('g.axistext').size()).toEqual(1);
149149
expect(d3.selectAll('g.hovertext').size()).toEqual(1);
150150
expect(d3.selectAll('g.axistext').select('text').html()).toEqual('0.388');
151-
expect(d3.selectAll('g.hovertext').select('text').html()).toEqual('<tspan class="line" dy="0em" x="9" y="-3.9453125">1</tspan><tspan class="line" dy="1.3em" x="9" y="-3.9453125">hover text</tspan>');
151+
expect(d3.selectAll('g.hovertext').select('text').selectAll('tspan').size()).toEqual(2);
152+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][0].innerHTML).toEqual('1')
153+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][1].innerHTML).toEqual('hover text')
152154
});
153155
});
154156

@@ -176,7 +178,9 @@ describe('hover info', function() {
176178

177179
expect(d3.selectAll('g.axistext').size()).toEqual(0);
178180
expect(d3.selectAll('g.hovertext').size()).toEqual(1);
179-
expect(d3.selectAll('g.hovertext').select('text').html()).toEqual('<tspan class="line" dy="0em" x="9" y="-3.9453125">1</tspan><tspan class="line" dy="1.3em" x="9" y="-3.9453125">hover text</tspan>');
181+
expect(d3.selectAll('g.hovertext').selectAll('tspan').size()).toEqual(2);
182+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][0].innerHTML).toEqual('1')
183+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][1].innerHTML).toEqual('hover text')
180184
});
181185
});
182186

@@ -233,7 +237,9 @@ describe('hover info', function() {
233237

234238
expect(d3.selectAll('g.axistext').size()).toEqual(0);
235239
expect(d3.selectAll('g.hovertext').size()).toEqual(1);
236-
expect(d3.selectAll('g.hovertext').select('text').html()).toEqual('<tspan class="line" dy="0em" x="9" y="-3.9453125">hover</tspan><tspan class="line" dy="1.3em" x="9" y="-3.9453125">text</tspan>');
240+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][0].innerHTML).toEqual('hover')
241+
expect(d3.selectAll('g.hovertext').selectAll('tspan')[0][1].innerHTML).toEqual('text')
242+
expect(d3.selectAll('g.hovertext').select('text').selectAll('tspan').size()).toEqual(2);
237243
});
238244
});
239245
});

0 commit comments

Comments
 (0)