Skip to content

Commit 63e44ab

Browse files
committed
fix hover label showarrow test
1 parent db04896 commit 63e44ab

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/jasmine/tests/hover_label_test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7073,14 +7073,14 @@ describe('hoverlabel.showarrow', function() {
70737073
margin: {l: 50, t: 50, r: 50, b: 50}
70747074
})
70757075
.then(function() {
7076-
_hover(200, 200); // Hover over middle point
7076+
_hover(200, 70); // Hover over middle point
70777077
})
70787078
.then(delay(HOVERMINTIME * 1.1))
70797079
.then(function() {
70807080
var pathD = getHoverPath();
70817081
expect(pathD).not.toBeNull('hover path should exist');
7082-
// Arrow paths contain 'L' commands for the triangular pointer
7083-
expect(pathD).toMatch(/M0,0L/, 'path should contain arrow (L command from origin)');
7082+
// Arrow paths contain 'L' commands starting from 0,0
7083+
expect(pathD).toMatch(/^M0,0L/, 'path should contain arrow (L command from 0,0)');
70847084
})
70857085
.then(done, done.fail);
70867086
});
@@ -7098,15 +7098,15 @@ describe('hoverlabel.showarrow', function() {
70987098
hoverlabel: { showarrow: false }
70997099
})
71007100
.then(function() {
7101-
_hover(200, 200); // Hover over middle point
7101+
_hover(200, 70); // Hover over middle point
71027102
})
71037103
.then(delay(HOVERMINTIME * 1.1))
71047104
.then(function() {
71057105
var pathD = getHoverPath();
71067106
expect(pathD).not.toBeNull('hover path should exist');
7107-
// No-arrow paths should be simple rectangles (no 'L' commands from origin)
7108-
expect(pathD).not.toMatch(/M0,0L/, 'path should not contain arrow');
7109-
expect(pathD).toMatch(/^M-/, 'path should start with rectangle (M- for left edge)');
7107+
// No-arrow paths should be simple rectangles (no 'L' commands starting at 0,0))
7108+
expect(pathD).not.toMatch(/^M0,0L/, 'path should not start at 0,0');
7109+
expect(pathD).toMatch(/^M[\d.-]+,[\d.-]+h/, 'path should start with some numeric point and move horizontally');
71107110
})
71117111
.then(done, done.fail);
71127112
});
@@ -7124,13 +7124,13 @@ describe('hoverlabel.showarrow', function() {
71247124
margin: {l: 50, t: 50, r: 50, b: 50}
71257125
})
71267126
.then(function() {
7127-
_hover(200, 200); // Hover over middle point
7127+
_hover(200, 70); // Hover over middle point
71287128
})
71297129
.then(delay(HOVERMINTIME * 1.1))
71307130
.then(function() {
71317131
var pathD = getHoverPath();
71327132
expect(pathD).not.toBeNull('hover path should exist');
7133-
expect(pathD).not.toMatch(/M0,0L/, 'trace-level showarrow:false should hide arrow');
7133+
expect(pathD).not.toMatch(/^M0,0L/, 'trace-level showarrow:false should hide arrow');
71347134
})
71357135
.then(done, done.fail);
71367136
});

0 commit comments

Comments
 (0)