MCPcopy
hub / github.com/plotly/plotly.js / assertHoverLabel

Function assertHoverLabel

test/jasmine/tests/annotations_test.js:1363–1382  ·  view source on GitHub ↗
(pos, text, msg)

Source from the content-addressed store, hash-verified

1361
1362 it('should register clicks and show hover effects on the text box only', function(done) {
1363 function assertHoverLabel(pos, text, msg) {
1364 return new Promise(function(resolve) {
1365 mouseEvent('mousemove', pos[0], pos[1]);
1366 mouseEvent('mouseover', pos[0], pos[1]);
1367
1368 setTimeout(function() {
1369 var hoverText = d3SelectAll('g.hovertext');
1370 expect(hoverText.size()).toEqual(text ? 1 : 0, msg);
1371
1372 if(text && hoverText.size()) {
1373 expect(hoverText.text()).toEqual(text, msg);
1374 }
1375
1376 mouseEvent('mouseout', pos[0], pos[1]);
1377 mouseEvent('mousemove', 0, 0);
1378
1379 setTimeout(resolve, HOVERMINTIME * 1.1);
1380 }, HOVERMINTIME * 1.1);
1381 });
1382 }
1383
1384 function assertHoverLabels(spec, msg) {
1385 // spec is an array of [pos, text]

Callers 1

assertHoverLabelsFunction · 0.85

Calls 1

mouseEventFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…