From 1313f9f28fc01eb5ed4575ed7d52ed2bf5ec02d9 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 9 May 2025 09:40:48 +0200 Subject: [PATCH] DEV: fix broken spec The main issue was that playwright was trying to to a scroll into view when starting the drag, and as a result the drag was not working. Doing the scroll manually before fixes this. --- spec/system/kanban_functionality_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/system/kanban_functionality_spec.rb b/spec/system/kanban_functionality_spec.rb index 8b071a7..0a28322 100644 --- a/spec/system/kanban_functionality_spec.rb +++ b/spec/system/kanban_functionality_spec.rb @@ -42,13 +42,14 @@ def tagged_topic(*tags) mode_chooser = PageObjects::Components::SelectKit.new(".kanban-mode-chooser") mode_chooser.expand mode_chooser.select_row_by_value("tags") - - mode_chooser = PageObjects::Components::SelectKit.new(".kanban-tag-chooser") - mode_chooser.expand - mode_chooser.select_row_by_value("active") - mode_chooser.select_row_by_value("backlog") mode_chooser.collapse + tag_chooser = PageObjects::Components::SelectKit.new(".kanban-tag-chooser") + tag_chooser.expand + tag_chooser.select_row_by_value("active") + tag_chooser.select_row_by_value("backlog") + tag_chooser.collapse + find(".kanban-modal .btn-primary").click expect(page).to have_css(".discourse-kanban-list", count: 2) @@ -62,8 +63,9 @@ def tagged_topic(*tags) expect(active_list).to have_css(".topic-card", count: 2) expect(backlog_list).to have_css(".topic-card", count: 2) - active_list.find("[data-topic-id='#{chat_active.id}']").drag_to(backlog_list) - + card = active_list.find("[data-topic-id='#{chat_active.id}']") + page.execute_script("arguments[0].scrollIntoView();", card) + card.drag_to(backlog_list) find(".dialog-content .btn-primary").click expect(active_list).to have_css(".topic-card", count: 1)