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

Function checkIfDraggable

test/jasmine/tests/config_test.js:302–320  ·  view source on GitHub ↗
(elClass)

Source from the content-addressed store, hash-verified

300 }
301
302 function checkIfDraggable(elClass) {
303 return function() {
304 var el = document.getElementsByClassName(elClass)[0];
305
306 var elBox = el.getBoundingClientRect();
307 var elX = elBox.left + elBox.width / 2;
308 var elY = elBox.top + elBox.height / 2;
309
310 mouseEvent('mousedown', elX, elY);
311 mouseEvent('mousemove', elX - 20, elY + 20);
312
313 var movedBox = el.getBoundingClientRect();
314
315 expect(movedBox.left).toBe(elBox.left - 20);
316 expect(movedBox.top).toBe(elBox.top + 20);
317
318 mouseEvent('mouseup', elX - 20, elY + 20);
319 };
320 }
321
322 it('should let edits override editable', function(done) {
323 var data = [{y: [1, 2, 3]}];

Callers 1

config_test.jsFile · 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…