mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 08:38:34 +00:00
fix(core): update and fix oxlint error (#13591)
#### PR Dependency Tree * **PR #13591** 👈 * **PR #13590** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Bug Fixes - Improved drag-and-drop stability: draggables, drop targets, and monitors now respond when option sources or external data change. - Improved async actions and permission checks to always use the latest callbacks and error handlers. - Chores - Lint/Prettier configs updated to ignore the Git directory. - Upgraded oxlint dev dependency. - Tests - Updated several end-to-end tests for more reliable text selection, focus handling, and timing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -59,27 +59,9 @@ test.describe('comments', () => {
|
||||
{ delay: 50 }
|
||||
);
|
||||
|
||||
// Select some text using triple-click and then refine selection
|
||||
// Triple-click to select the entire paragraph
|
||||
await page.locator('affine-paragraph').first().click({ clickCount: 3 });
|
||||
|
||||
// Wait for selection
|
||||
await page.waitForTimeout(100);
|
||||
|
||||
// Now we have the whole paragraph selected, let's use mouse to select just "some text"
|
||||
const paragraph = page.locator('affine-paragraph').first();
|
||||
const bbox = await paragraph.boundingBox();
|
||||
if (!bbox) throw new Error('Paragraph not found');
|
||||
|
||||
// Click and drag to select "some text" portion
|
||||
// Start roughly where "some" begins (estimated position)
|
||||
await page.mouse.move(bbox.x + bbox.width * 0.45, bbox.y + bbox.height / 2);
|
||||
await page.mouse.down();
|
||||
await page.mouse.move(bbox.x + bbox.width * 0.58, bbox.y + bbox.height / 2);
|
||||
await page.mouse.up();
|
||||
|
||||
// Wait a bit for selection to stabilize
|
||||
await page.waitForTimeout(200);
|
||||
for (let i = 0; i < 11; i++) {
|
||||
await page.keyboard.press('Shift+ArrowLeft');
|
||||
}
|
||||
|
||||
// Wait for the toolbar to appear after text selection
|
||||
const toolbar = page.locator('editor-toolbar');
|
||||
@@ -97,11 +79,14 @@ test.describe('comments', () => {
|
||||
await page.waitForTimeout(300); // Wait for sidebar animation
|
||||
|
||||
// Find the comment editor
|
||||
const commentEditor = page.locator('.comment-editor-viewport');
|
||||
const commentEditor = page.locator(
|
||||
'.comment-editor-viewport .page-editor-container'
|
||||
);
|
||||
await expect(commentEditor).toBeVisible();
|
||||
|
||||
// Enter comment text
|
||||
await commentEditor.click();
|
||||
await commentEditor.focus();
|
||||
await page.keyboard.type('This is my first comment on this text', {
|
||||
delay: 50,
|
||||
});
|
||||
@@ -125,11 +110,7 @@ test.describe('comments', () => {
|
||||
// The preview should show the selected text that was commented on
|
||||
// Target specifically the sidebar tab content to avoid conflicts with editor content
|
||||
const sidebarTab = page.getByTestId('sidebar-tab-content-comment');
|
||||
await expect(
|
||||
sidebarTab.locator(
|
||||
'text=This is a test paragraph with some text that we will comment on.'
|
||||
)
|
||||
).toBeVisible();
|
||||
await expect(sidebarTab.locator('text=comment on.')).toBeVisible();
|
||||
|
||||
// This text should appear in the sidebar as the preview of what was commented on
|
||||
|
||||
|
||||
@@ -281,6 +281,7 @@ test('link bar should not be appear when the range is collapsed', async ({
|
||||
await expect(linkPopoverLocator).toBeVisible();
|
||||
|
||||
await focusRichText(page); // click to cancel the link popover
|
||||
await waitNextFrame(page);
|
||||
await focusRichTextEnd(page);
|
||||
await pressShiftEnter(page);
|
||||
await waitNextFrame(page);
|
||||
|
||||
Reference in New Issue
Block a user