From 49f97f1b11031cbeaf60a5001b6d9cc7b1f99b5a Mon Sep 17 00:00:00 2001
From: rhenck <richard.henck@iqb.hu-berlin.de>
Date: Thu, 28 Mar 2024 18:08:20 +0100
Subject: [PATCH] [e2e] Fix DropList tests to leave the source list

This is necessary now because mouseenter events are only handled when
not already being over a list.
---
 e2e/tests/e2e/droplist-util.ts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/e2e/tests/e2e/droplist-util.ts b/e2e/tests/e2e/droplist-util.ts
index ebe5e94d1..09ef49233 100644
--- a/e2e/tests/e2e/droplist-util.ts
+++ b/e2e/tests/e2e/droplist-util.ts
@@ -22,9 +22,15 @@ export function addOption(optionName: string): void {
 export function dragTo(list: string, item: string, targetList: string): void {
   cy.get(`#${list}`).contains('.drop-list-item', item)
     .trigger('mousedown', { button: 0 });
+
   // Moving the mouse is actually not necessary, since the mouseenter event is not triggered.
   // It is triggered manually in the next step.
   // cy.get('.drag-preview').trigger('mousemove', { force: true, clientX: 640, clientY: 199 });
+
+  // Leave first, to change a variable and actually handle mouseenter events
+  cy.get(`#${list}`)
+    .trigger('mouseleave');
+
   cy.get(`#${targetList}`)
     .trigger('mouseenter');
   cy.get('.drag-preview')
-- 
GitLab