mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 14:56:59 +08:00
feat(web): drag page to trash folder (#2385)
Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
43
tests/parallels/drag-page-to-trash-folder.spec.ts
Normal file
43
tests/parallels/drag-page-to-trash-folder.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { test } from '@affine-test/kit/playwright';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { openHomePage } from '../libs/load-page';
|
||||
import { waitMarkdownImported } from '../libs/page-logic';
|
||||
|
||||
test('drag a page from "All pages" list onto the "Trash" folder in the sidebar to move it to trash list', async ({
|
||||
page,
|
||||
}) => {
|
||||
// TODO-Doma
|
||||
// Init test db with known workspaces and open "All Pages" page via url directly
|
||||
{
|
||||
await openHomePage(page);
|
||||
await waitMarkdownImported(page);
|
||||
await page.getByText('All Pages').click();
|
||||
}
|
||||
|
||||
// Drag-and-drop
|
||||
// Ref: https://playwright.dev/docs/input#dragging-manually
|
||||
await page.getByText('AFFiNE - not just a note taking app').hover();
|
||||
await page.mouse.down();
|
||||
await page.waitForTimeout(10);
|
||||
await page.getByText('Trash').hover();
|
||||
await page.mouse.up();
|
||||
|
||||
await expect(
|
||||
page.getByText('Successfully deleted'),
|
||||
'A toast containing success message is shown'
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByText('AFFiNE - not just a note taking app'),
|
||||
'The deleted post is no longer on the All Page list'
|
||||
).toHaveCount(0);
|
||||
|
||||
// TODO-Doma
|
||||
// Visit trash page via url
|
||||
await page.getByText('Trash', { exact: true }).click();
|
||||
await expect(
|
||||
page.getByText('AFFiNE - not just a note taking app'),
|
||||
'The deleted post exists in the Trash list'
|
||||
).toHaveCount(1);
|
||||
});
|
||||
Reference in New Issue
Block a user