Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/e2e/puppeteer/__tests__/drag-and-drop-multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down
5 changes: 2 additions & 3 deletions src/e2e/puppeteer/__tests__/drag-and-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
await dragAndDropThought('a', null, { position: 'none', showAlert: true })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 90 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > Alert

Error: Expected image to match or be a close match to snapshot but was 1.28% different from snapshot (6144 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-alert-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:90:19

Check failure on line 90 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > Alert

Error: Expected image to match or be a close match to snapshot but was 1.28% different from snapshot (6144 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-alert-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:90:19
})

it('DragAndDropThought', async () => {
Expand All @@ -101,7 +101,7 @@
await dragAndDropThought('a', 'd', { position: 'after' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 104 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DragAndDropThought

Error: Expected image to match or be a close match to snapshot but was 0.43520833333333336% different from snapshot (2089 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drag-and-drop-thought-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:104:19

Check failure on line 104 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DragAndDropThought

Error: Expected image to match or be a close match to snapshot but was 0.43520833333333336% different from snapshot (2089 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drag-and-drop-thought-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:104:19
})

it('DropChild', async () => {
Expand All @@ -115,7 +115,7 @@
await dragAndDropThought('a', 'b', { position: 'child' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 118 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropChild

Error: Expected image to match or be a close match to snapshot but was 0.4485416666666667% different from snapshot (2153 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-child-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:118:19

Check failure on line 118 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropChild

Error: Expected image to match or be a close match to snapshot but was 0.4485416666666667% different from snapshot (2153 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-child-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:118:19
})

it('DropEnd', async () => {
Expand All @@ -131,7 +131,7 @@
await dragAndDropThought('x', 'c', { position: 'after' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 134 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropEnd

Error: Expected image to match or be a close match to snapshot but was 0.399375% different from snapshot (1917 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-end-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:134:19

Check failure on line 134 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropEnd

Error: Expected image to match or be a close match to snapshot but was 0.399375% different from snapshot (1917 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-end-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:134:19
})

it('DropUncle', async () => {
Expand All @@ -149,7 +149,7 @@
await dragAndDropThought('c', 'e', { position: 'before', dropUncle: true })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot({

Check failure on line 152 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropUncle

Error: Expected image to match or be a close match to snapshot but was 0.389375% different from snapshot (1869 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-uncle-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:152:19

Check failure on line 152 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > DropUncle

Error: Expected image to match or be a close match to snapshot but was 0.389375% different from snapshot (1869 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-uncle-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:152:19
customDiffConfig: {
threshold: UNCLE_DIFF_THRESHOLD,
},
Expand All @@ -174,7 +174,7 @@
await dragAndDropThought('x', 'd', { position: 'after', dropUncle: true })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 177 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after table

Error: Expected image to match or be a close match to snapshot but was 0.46541666666666665% different from snapshot (2234 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-table-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:177:19

Check failure on line 177 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after table

Error: Expected image to match or be a close match to snapshot but was 0.46541666666666665% different from snapshot (2234 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-table-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:177:19
})

it('drop hover after column two thought', async () => {
Expand All @@ -195,7 +195,7 @@
await dragAndDropThought('x', 'c', { position: 'after' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 198 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after column two thought

Error: Expected image to match or be a close match to snapshot but was 0.40229166666666666% different from snapshot (1931 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-column-two-thought-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:198:19

Check failure on line 198 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after column two thought

Error: Expected image to match or be a close match to snapshot but was 0.40229166666666666% different from snapshot (1931 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-column-two-thought-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:198:19
})

it('drop hover after table column one', async () => {
Expand All @@ -216,7 +216,7 @@
await dragAndDropThought('x', 'd', { position: 'after' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 219 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after table column one

Error: Expected image to match or be a close match to snapshot but was 0.46666666666666673% different from snapshot (2240 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-table-column-one-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:219:19

Check failure on line 219 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after table column one

Error: Expected image to match or be a close match to snapshot but was 0.46666666666666673% different from snapshot (2240 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-table-column-one-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:219:19
})

it('drop hover after first thought of column one', async () => {
Expand All @@ -239,7 +239,7 @@
await dragAndDropThought('x', 'd', { position: 'before' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 242 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after first thought of column one

Error: Expected image to match or be a close match to snapshot but was 14.746041666666668% different from snapshot (70781 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-first-thought-of-column-one-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:242:19

Check failure on line 242 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover after first thought of column one

Error: Expected image to match or be a close match to snapshot but was 14.746041666666668% different from snapshot (70781 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-after-first-thought-of-column-one-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:242:19
})

it('drop hover of first child of col2', async () => {
Expand All @@ -259,7 +259,7 @@
await dragAndDropThought('x', 'd', { position: 'before' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()

Check failure on line 262 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover of first child of col2

Error: Expected image to match or be a close match to snapshot but was 0.45333333333333337% different from snapshot (2176 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-of-first-child-of-col-2-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:262:19

Check failure on line 262 in src/e2e/puppeteer/__tests__/drag-and-drop.ts

View workflow job for this annotation

GitHub Actions / Puppeteer

src/e2e/puppeteer/__tests__/drag-and-drop.ts > drag > drop hover of first child of col2

Error: Expected image to match or be a close match to snapshot but was 0.45333333333333337% different from snapshot (2176 differing pixels). See diff for details: /home/runner/work/em/em/src/e2e/puppeteer/__tests__/__image_snapshots__/drag-and-drop/__diff_output__/drag-drop-hover-of-first-child-of-col-2-1-diff.png ❯ src/e2e/puppeteer/__tests__/drag-and-drop.ts:262:19
})

it('drop target last child in cliff', async () => {
Expand Down Expand Up @@ -307,13 +307,12 @@
// 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,
})

Expand Down Expand Up @@ -357,7 +356,7 @@
- d
`)

await dragAndDropThought('a', 'd', { position: 'after', mouseUp: true })
await dragAndDropThought('a', 'd', { position: 'after' })

const image = await takeScreenshot()
expect(image).toMatchImageSnapshot()
Expand Down
8 changes: 4 additions & 4 deletions src/e2e/puppeteer/helpers/dragAndDropThought.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down