Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix toaster dismission not being registered

Dombi Attila5eac52fa71c7
diff --git a/spec/support/toasts/expectations.rb b/spec/support/toasts/expectations.rb
index ecadb2d9bf4..a50fdfc83b0 100644
--- a/spec/support/toasts/expectations.rb
+++ b/spec/support/toasts/expectations.rb
@@ -15,18 +15,19 @@ module Toasts
def expect_and_dismiss_toaster(message: nil, type: :success)
expect_toast(type:, message:)
dismiss_toaster!
- expect_no_toaster(type:, message:)
+ expect_no_toaster(type:, message:, wait: 0.1)
end
def dismiss_toaster!
+ sleep 0.1
page.find('.op-toast--close').click
end
- def expect_no_toaster(type: :success, message: nil)
+ def expect_no_toaster(type: :success, message: nil, wait: 10)
if type.nil?
- expect(page).to have_no_css(".op-toast")
+ expect(page).to have_no_css(".op-toast", wait:)
else
- expect(page).to have_no_css(".op-toast.-#{type}", text: message)
+ expect(page).to have_no_css(".op-toast.-#{type}", text: message, wait:)
end
end