2024-06-27 09:18:16 +03:00
|
|
|
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
|
2024-07-29 11:42:22 +03:00
|
|
|
await page.locator('.edgeless-note-page-content').click({ force: true });
|
|
|
|
await page.locator('.edgeless-note-page-content').click({ force: true });
|
|
|
|
await page.waitForTimeout(100);
|
2024-07-17 13:30:46 +03:00
|
|
|
await page
|
2024-07-29 11:42:22 +03:00
|
|
|
.locator('.edgeless-note-page-content')
|
2024-07-17 13:30:46 +03:00
|
|
|
.pressSequentially('test text');
|
2024-07-29 11:42:22 +03:00
|
|
|
await expect(page.locator('.edgeless-note-page-content')).toContainText(
|
2024-07-17 13:30:46 +03:00
|
|
|
'test text'
|
|
|
|
);
|
2024-06-27 09:18:16 +03:00
|
|
|
});
|