From c4051d6ebfdc4eb49f891c53b184693fe5196db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Trzci=C5=84ski?= Date: Thu, 10 Oct 2024 12:42:28 +0200 Subject: [PATCH] [#67095] fix comment drag test --- tests/myst-editor.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/myst-editor.spec.ts b/tests/myst-editor.spec.ts index 09c7730..d3e9897 100644 --- a/tests/myst-editor.spec.ts +++ b/tests/myst-editor.spec.ts @@ -253,6 +253,10 @@ test.describe.parallel("With collaboration enabled", () => { await addComment(pageA, 1); // Drag the comment + const initialCommentPosition = await pageA + .locator(".comment-wrapper") + .first() + .evaluate(e => Number(e.parentElement?.getAttribute("top"))); const placesForCommentA = await pageA.locator(".comment-gutter-icon").all(); const from = await pageA.locator(".comment-icon").boundingBox() as { x: number; y: number; width: number; height: number; }; @@ -271,7 +275,7 @@ test.describe.parallel("With collaboration enabled", () => { .locator(".comment-wrapper") .first() .evaluate(e => Number(e.parentElement?.getAttribute("top"))); - expect(newCommentPosition - to.x).toBeLessThan(to.height); + expect(newCommentPosition ).not.toEqual(initialCommentPosition); });