mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
test: add test for undo empty page (#7348)
This commit is contained in:
23
tests/affine-local/e2e/undo-empty.spec.ts
Normal file
23
tests/affine-local/e2e/undo-empty.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { clickEdgelessModeButton } from '@affine-test/kit/utils/editor';
|
||||||
|
import { openHomePage } from '@affine-test/kit/utils/load-page';
|
||||||
|
import {
|
||||||
|
clickNewPageButton,
|
||||||
|
getBlockSuiteEditorTitle,
|
||||||
|
waitForEmptyEditor,
|
||||||
|
} from '@affine-test/kit/utils/page-logic';
|
||||||
|
import test, { expect } from '@playwright/test';
|
||||||
|
|
||||||
|
test('should be able to undo on empty page', async ({ page }) => {
|
||||||
|
await openHomePage(page);
|
||||||
|
await clickNewPageButton(page);
|
||||||
|
await getBlockSuiteEditorTitle(page).isVisible();
|
||||||
|
await waitForEmptyEditor(page);
|
||||||
|
await clickEdgelessModeButton(page);
|
||||||
|
await page.keyboard.press('ControlOrMeta+Z');
|
||||||
|
|
||||||
|
// test editor still work
|
||||||
|
await page.locator('affine-note').click({ force: true });
|
||||||
|
await page.locator('affine-note').click({ force: true });
|
||||||
|
await page.locator('affine-note').pressSequentially('test text');
|
||||||
|
await expect(page.locator('affine-note')).toContainText('test text');
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user