Skip to content

Commit 4f203fe

Browse files
authored
DEV: fix broken spec (#84)
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.
1 parent 7727451 commit 4f203fe

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

spec/system/kanban_functionality_spec.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ def tagged_topic(*tags)
4242
mode_chooser = PageObjects::Components::SelectKit.new(".kanban-mode-chooser")
4343
mode_chooser.expand
4444
mode_chooser.select_row_by_value("tags")
45-
46-
mode_chooser = PageObjects::Components::SelectKit.new(".kanban-tag-chooser")
47-
mode_chooser.expand
48-
mode_chooser.select_row_by_value("active")
49-
mode_chooser.select_row_by_value("backlog")
5045
mode_chooser.collapse
5146

47+
tag_chooser = PageObjects::Components::SelectKit.new(".kanban-tag-chooser")
48+
tag_chooser.expand
49+
tag_chooser.select_row_by_value("active")
50+
tag_chooser.select_row_by_value("backlog")
51+
tag_chooser.collapse
52+
5253
find(".kanban-modal .btn-primary").click
5354

5455
expect(page).to have_css(".discourse-kanban-list", count: 2)
@@ -62,8 +63,9 @@ def tagged_topic(*tags)
6263
expect(active_list).to have_css(".topic-card", count: 2)
6364
expect(backlog_list).to have_css(".topic-card", count: 2)
6465

65-
active_list.find("[data-topic-id='#{chat_active.id}']").drag_to(backlog_list)
66-
66+
card = active_list.find("[data-topic-id='#{chat_active.id}']")
67+
page.execute_script("arguments[0].scrollIntoView();", card)
68+
card.drag_to(backlog_list)
6769
find(".dialog-content .btn-primary").click
6870

6971
expect(active_list).to have_css(".topic-card", count: 1)

0 commit comments

Comments
 (0)