Skip to content

Commit 0d555b4

Browse files
committed
test that svg text output has no newlines in it
1 parent 2105930 commit 0d555b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ describe('hover info', function() {
103103
var mockCopy = Lib.extendDeep({}, mock);
104104

105105
mockCopy.data[0].text = [];
106-
mockCopy.data[0].text[17] = 'hover text';
106+
// we convert newlines to spaces
107+
// see https://github.com/plotly/plotly.js/issues/746
108+
mockCopy.data[0].text[17] = 'hover\ntext\n\rwith\r\nspaces\n\nnot\rnewlines';
107109
mockCopy.data[0].hoverinfo = 'text';
108110

109111
beforeEach(function(done) {
@@ -123,7 +125,8 @@ describe('hover info', function() {
123125

124126
expect(d3.selectAll('g.axistext').size()).toEqual(0);
125127
expect(d3.selectAll('g.hovertext').size()).toEqual(1);
126-
expect(d3.selectAll('g.hovertext').select('text').html()).toEqual('hover text');
128+
expect(d3.selectAll('g.hovertext').select('text').html())
129+
.toEqual('hover text with spaces not newlines');
127130
});
128131
});
129132

0 commit comments

Comments
 (0)