-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 1395602 Author: ShaMan123 <shacharnen@gmail.com> Date: Wed Oct 18 18:23:35 2023 +0700 prettier commit d7fe84b Merge: d1f9b4d 7a71097 Author: ShaMan123 <shacharnen@gmail.com> Date: Wed Oct 18 18:19:27 2023 +0700 Merge branch 'master' into parent commit d1f9b4d Merge: 0b43b72 ef27fcd Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Sep 23 14:00:34 2023 +0530 Merge branch 'master' into parent commit 0b43b72 Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Sep 23 13:33:25 2023 +0530 another parent/group fix commit 89e4c74 Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Sep 16 08:56:50 2023 +0530 e2e test Update index.spec.ts commit c2fc529 Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Sep 16 07:51:06 2023 +0530 comments commit a09f840 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Sat Sep 16 02:18:07 2023 +0000 update CHANGELOG.md commit b3bc476 Author: ShaMan123 <shacharnen@gmail.com> Date: Sat Sep 16 07:37:01 2023 +0530 refactor(): `parent` + fix active selection edge case
- Loading branch information
Showing
11 changed files
with
174 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,55 @@ | ||
import type { Page } from '@playwright/test'; | ||
import { expect, test } from '@playwright/test'; | ||
import setup from '../../../setup'; | ||
import { CanvasUtil } from '../../../utils/CanvasUtil'; | ||
|
||
setup(); | ||
|
||
test('selection stale state #9087', async ({ page }) => { | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('rotate', async () => { | ||
await page.mouse.move(400, 150); | ||
await page.mouse.down(); | ||
await page.mouse.move(570, 150, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('deselect', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
const tests = [ | ||
{ | ||
name: 'selection stale state #9087', | ||
step: (page: Page) => | ||
test.step('deselect', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.up(); | ||
}), | ||
}, | ||
{ | ||
name: 'replacing selection', | ||
step: (page: Page) => | ||
test.step('replace selection', () => | ||
new CanvasUtil(page).executeInBrowser((canvas) => { | ||
canvas.setActiveObject( | ||
new fabric.ActiveSelection(canvas.getActiveObjects()) | ||
); | ||
})), | ||
}, | ||
]; | ||
|
||
for (const { name, step } of tests) { | ||
test(name, async ({ page }) => { | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await test.step('rotate', async () => { | ||
await page.mouse.move(400, 150); | ||
await page.mouse.down(); | ||
await page.mouse.move(570, 150, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
await step(page); | ||
await test.step('select', async () => { | ||
await page.mouse.move(20, 20); | ||
await page.mouse.down(); | ||
await page.mouse.move(600, 600, { steps: 20 }); | ||
await page.mouse.up(); | ||
}); | ||
expect(await new CanvasUtil(page).screenshot()).toMatchSnapshot({ | ||
name: 'selection-stale-state.png', | ||
}); | ||
}); | ||
expect(await new CanvasUtil(page).screenshot()).toMatchSnapshot(); | ||
}); | ||
} |
Binary file removed
BIN
-12.5 KB
.../selection/stale-state/index.spec.ts-snapshots/selection-stale-state-9087-1.png
Binary file not shown.
Binary file added
BIN
+13.9 KB
e2e/tests/selection/stale-state/index.spec.ts-snapshots/selection-stale-state.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters