mirror of
https://github.com/Shopify/draggable.git
synced 2025-12-08 20:15:56 +00:00
update waitForDragDelay param
This commit is contained in:
parent
dc51c22f38
commit
c21ddf8a4f
@ -326,7 +326,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const containerChildren = newInstance.getDraggableElementsForContainer(draggableElement.parentNode);
|
||||
|
||||
@ -349,7 +349,7 @@ describe('Draggable', () => {
|
||||
const dynamicContainer = document.querySelector('.DynamicContainer');
|
||||
|
||||
clickMouse(draggableElement);
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
moveMouse(dynamicContainer);
|
||||
|
||||
expect(dragOverContainerHandler).not.toHaveBeenCalled();
|
||||
@ -361,7 +361,7 @@ describe('Draggable', () => {
|
||||
expect(newInstance.containers).toEqual([...containers, dynamicContainer]);
|
||||
|
||||
clickMouse(draggableElement);
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
moveMouse(dynamicContainer);
|
||||
expect(dragOverContainerHandler).toHaveBeenCalled();
|
||||
|
||||
@ -383,7 +383,7 @@ describe('Draggable', () => {
|
||||
const dynamicContainer = document.querySelector('.DynamicContainer');
|
||||
|
||||
clickMouse(draggableElement);
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
moveMouse(dynamicContainer);
|
||||
|
||||
expect(dragOverContainerHandler).toHaveBeenCalled();
|
||||
@ -398,7 +398,7 @@ describe('Draggable', () => {
|
||||
newInstance.on('drag:over:container', dragOverContainerHandler);
|
||||
|
||||
clickMouse(draggableElement);
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
moveMouse(dynamicContainer);
|
||||
|
||||
expect(dragOverContainerHandler).not.toHaveBeenCalled();
|
||||
@ -483,7 +483,7 @@ describe('Draggable', () => {
|
||||
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const call = callback.mock.calls[0][0];
|
||||
|
||||
@ -507,7 +507,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
triggerEvent(draggableElement, 'dragstart', {button: 0});
|
||||
|
||||
@ -540,7 +540,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
triggerEvent(draggableElement, 'dragstart', {button: 0});
|
||||
|
||||
@ -559,7 +559,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const callback = jest.fn();
|
||||
newInstance.on('drag:move', callback);
|
||||
@ -593,7 +593,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const callback = jest.fn();
|
||||
newInstance.on('drag:stop', callback);
|
||||
@ -617,7 +617,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(newInstance.source.classList).toContain('draggable-source--is-dragging');
|
||||
|
||||
@ -634,7 +634,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const source = newInstance.source;
|
||||
|
||||
@ -659,7 +659,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
const source = newInstance.source;
|
||||
|
||||
@ -679,7 +679,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(document.body.classList).toContain('draggable--is-dragging');
|
||||
|
||||
@ -697,7 +697,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
expect(document.body.classList).toContain('draggable--is-dragging');
|
||||
|
||||
triggerEvent(document.body, 'mouseup', {button: 0});
|
||||
@ -719,7 +719,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(document.body.classList).not.toContain('draggable--is-dragging');
|
||||
|
||||
@ -737,7 +737,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
triggerEvent(draggableElement, 'mouseup', {button: 0});
|
||||
|
||||
@ -755,7 +755,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
triggerEvent(document.body, 'mouseup', {button: 0});
|
||||
|
||||
@ -778,7 +778,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(containers[0].classList).toContain('draggable-container--is-dragging');
|
||||
|
||||
@ -796,7 +796,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(containers[0].classList).toContain('draggable-container--is-dragging');
|
||||
|
||||
@ -818,7 +818,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(containers[0].classList).not.toContain('draggable-container--is-dragging');
|
||||
|
||||
@ -835,7 +835,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(draggableElement.classList.contains(newInstance.getClassNameFor('source:original'))).toBeTruthy();
|
||||
|
||||
@ -863,7 +863,7 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement, 'mousedown', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
expect(newInstance.isDragging()).toBe(true);
|
||||
|
||||
@ -871,13 +871,13 @@ describe('Draggable', () => {
|
||||
triggerEvent(draggableElement.nextElementSibling, 'mousemove', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
document.elementFromPoint = () => document.body;
|
||||
triggerEvent(document.body, 'mousemove', {button: 0});
|
||||
|
||||
// Wait for delay
|
||||
waitForDragDelay(100);
|
||||
waitForDragDelay();
|
||||
|
||||
triggerEvent(document.body, 'mouseup', {button: 0});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user