mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Use new helpers in flaky specs to properly wait for turbo
This commit is contained in:
@@ -61,7 +61,9 @@ RSpec.describe "Favorite projects", :js do
|
||||
visit project_path(project)
|
||||
expect(page).to have_css "a", accessible_name: "Add to favorites"
|
||||
|
||||
click_link_or_button(accessible_name: "Add to favorites")
|
||||
wait_for_turbo do
|
||||
click_link_or_button(accessible_name: "Add to favorites")
|
||||
end
|
||||
|
||||
expect(page).to have_css "a", accessible_name: "Remove from favorites"
|
||||
|
||||
|
||||
@@ -366,13 +366,11 @@ RSpec.describe "Project list sharing",
|
||||
# Toggle the switch to make the project list query public
|
||||
share_dialog.expect_toggle_public_off
|
||||
|
||||
share_dialog.toggle_public
|
||||
|
||||
retry_block do
|
||||
# dialog body is replaced on toggle by turbo stream, we have to wait for the render to be completed so we
|
||||
# retry the expectation until the toggle is on again
|
||||
share_dialog.expect_toggle_public_on
|
||||
wait_for_turbo_stream do
|
||||
share_dialog.toggle_public
|
||||
end
|
||||
|
||||
share_dialog.expect_toggle_public_on
|
||||
share_dialog.close
|
||||
|
||||
# Reopen the dialog and expect the public state to be kept
|
||||
|
||||
Reference in New Issue
Block a user