Use new helpers in flaky specs to properly wait for turbo

This commit is contained in:
Klaus Zanders
2026-03-20 14:59:39 +01:00
parent 6fb0a0e897
commit ea2f602d79
2 changed files with 7 additions and 7 deletions
+3 -1
View File
@@ -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