diff --git a/src/e2e/puppeteer/__tests__/drag-and-drop-multiselect.ts b/src/e2e/puppeteer/__tests__/drag-and-drop-multiselect.ts index 863736461f5..d6eeec610e2 100644 --- a/src/e2e/puppeteer/__tests__/drag-and-drop-multiselect.ts +++ b/src/e2e/puppeteer/__tests__/drag-and-drop-multiselect.ts @@ -21,7 +21,7 @@ describe('drag and drop multiple thoughts', () => { `) await multiselectThoughts(['y', 'z', 'a']) - await dragAndDropThought('a', 'x', { position: 'before', mouseUp: true }) + await dragAndDropThought('a', 'x', { position: 'before' }) const exported = await exportThoughts() expect(exported).toBe(`- ${HOME_TOKEN} @@ -40,7 +40,7 @@ describe('drag and drop multiple thoughts', () => { `) await multiselectThoughts(['y', 'z']) - await dragAndDropThought('z', 'a', { position: 'after', mouseUp: true }) + await dragAndDropThought('z', 'a', { position: 'after' }) const exported = await exportThoughts() expect(exported).toBe(`- ${HOME_TOKEN} @@ -59,7 +59,7 @@ describe('drag and drop multiple thoughts', () => { `) await multiselectThoughts(['y', 'z']) - await dragAndDropThought('z', 'a', { position: 'child', mouseUp: true }) + await dragAndDropThought('z', 'a', { position: 'child' }) const exported = await exportThoughts() expect(exported).toBe(`- ${HOME_TOKEN} @@ -79,7 +79,7 @@ describe('drag and drop multiple thoughts', () => { // Select in random order: a, x, y await multiselectThoughts(['a', 'x', 'y']) - await dragAndDropThought('y', 'z', { position: 'child', mouseUp: true }) + await dragAndDropThought('y', 'z', { position: 'child' }) const exported = await exportThoughts() expect(exported).toBe(`- ${HOME_TOKEN} @@ -104,7 +104,7 @@ describe('drag and drop multiple thoughts', () => { // Drag b and e into the sorted context await multiselectThoughts(['e', 'b']) - await dragAndDropThought('e', 'parent', { position: 'child', mouseUp: true }) + await dragAndDropThought('e', 'parent', { position: 'child' }) const exported = await exportThoughts() expect(exported).toBe(`- ${HOME_TOKEN} diff --git a/src/e2e/puppeteer/__tests__/drag-and-drop.ts b/src/e2e/puppeteer/__tests__/drag-and-drop.ts index ecdeec3defd..fd933783037 100644 --- a/src/e2e/puppeteer/__tests__/drag-and-drop.ts +++ b/src/e2e/puppeteer/__tests__/drag-and-drop.ts @@ -307,13 +307,12 @@ describe('drag', () => { // First, drag thought 'a' after thought 'b' (resulting in b followed by a) await dragAndDropThought('a', 'b', { position: 'after', - mouseUp: true, showAlert: true, }) await dragAndDropThought('a', null, { position: 'none', - mouseUp: false, + dragOnly: true, showAlert: true, }) @@ -357,7 +356,7 @@ describe('drop', () => { - d `) - await dragAndDropThought('a', 'd', { position: 'after', mouseUp: true }) + await dragAndDropThought('a', 'd', { position: 'after' }) const image = await takeScreenshot() expect(image).toMatchImageSnapshot() diff --git a/src/e2e/puppeteer/helpers/dragAndDropThought.ts b/src/e2e/puppeteer/helpers/dragAndDropThought.ts index 2aa6225e5d3..7159386567a 100644 --- a/src/e2e/puppeteer/helpers/dragAndDropThought.ts +++ b/src/e2e/puppeteer/helpers/dragAndDropThought.ts @@ -11,15 +11,15 @@ const dragAndDropThought = async ( destValue: string | null, { dropUncle, - mouseUp, + dragOnly, position, showAlert, skipMouseDown, }: { /** If true, the source thought is dropped as a sibling to the hidden uncle. */ dropUncle?: boolean - /** If true, the mouse button is released after the drop. */ - mouseUp?: boolean + /** If true, only performs the drag without releasing the mouse button. */ + dragOnly?: boolean /** Determines where the destination thought is dropped, relative to the source thought. - after: drop the source thought as a sibling after the destination thought. - before: drop the source thought as a sibling before the destination thought. @@ -95,7 +95,7 @@ const dragAndDropThought = async ( await page.locator('[data-testid="alert-content"]').wait() - if (mouseUp) { + if (!dragOnly) { await page.mouse.up() // Wait for drag operation to fully complete by checking: