From e00c7f7d2b29839a86d8fd94e7fe7dfaef054f8b Mon Sep 17 00:00:00 2001 From: Spoffy <4805393+Spoffy@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:39:57 +0100 Subject: [PATCH] Fixes flaky ViewLayoutCollapse test (#1027) This fixes the flaky test in "ViewLayoutCollapse.ts": "fix: should not dispose the instance when drag is cancelled". The 'mouseenter' event wasn't consistently triggering properly on the drop target (LayoutEditor.ts - line 342) when the mouse was moved onto it. The change simulates a "drag" over the drop target, moving the mouse into multiple positions over it, seemingly fixing the problem. --- test/nbrowser/ViewLayoutCollapse.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/nbrowser/ViewLayoutCollapse.ts b/test/nbrowser/ViewLayoutCollapse.ts index 88f10ad4..9086e921 100644 --- a/test/nbrowser/ViewLayoutCollapse.ts +++ b/test/nbrowser/ViewLayoutCollapse.ts @@ -311,7 +311,9 @@ describe("ViewLayoutCollapse", function() { // Move back and drop. await gu.getSection(COMPANIES_CHART).getRect(); - await move(getDragElement(COMPANIES_CHART)); + await move(getDragElement(COMPANIES_CHART), {x : 50}); + await driver.sleep(100); + await move(getDragElement(COMPANIES_CHART), {x : 100}); await driver.sleep(100); await move(getDragElement(COMPANIES_CHART), {x : 200}); await gu.waitToPass(async () => {