-
-
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.
refactor(): expose
Object#parent
instead of getParent` (#8951)
- Loading branch information
Showing
15 changed files
with
210 additions
and
134 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
Oops, something went wrong.