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

replacing flash with toast in two tests which are flickering on dev

bsatarnejad11d7351ef12a
diff --git a/spec/features/admin/test_mail_notification_spec.rb b/spec/features/admin/test_mail_notification_spec.rb
index 11224c7bf3c..7fa3a55e42b 100644
--- a/spec/features/admin/test_mail_notification_spec.rb
+++ b/spec/features/admin/test_mail_notification_spec.rb
@@ -44,7 +44,7 @@ RSpec.describe 'Test mail notification', js: true, with_cuprite: true do
click_link 'Send a test email'
expected = "An error occurred while sending mail (#{error_message})"
- expect(page).to have_selector('.flash.error', text: expected)
- expect(page).not_to have_selector('.flash.error strong')
+ expect(page).to have_selector('.op-toast.-error', text: expected)
+ expect(page).not_to have_selector('.op-toast.-error strong')
end
end
diff --git a/spec/features/work_packages/bulk/move_work_package_spec.rb b/spec/features/work_packages/bulk/move_work_package_spec.rb
index 0fe4cce5ef4..994853e257f 100644
--- a/spec/features/work_packages/bulk/move_work_package_spec.rb
+++ b/spec/features/work_packages/bulk/move_work_package_spec.rb
@@ -161,7 +161,7 @@ RSpec.describe 'Moving a work package through Rails view', js: true do
end
expect(page)
- .to have_selector('.flash.error',
+ .to have_selector('.op-toast.-error',
text: I18n.t(:'work_packages.bulk.none_could_be_saved',
total: 1))
child_wp.reload
@@ -182,7 +182,7 @@ RSpec.describe 'Moving a work package through Rails view', js: true do
click_on 'Move and follow'
end
- expect(page).to have_selector('.flash.notice')
+ expect(page).to have_selector('.op-toast.-success')
child_wp.reload
work_package.reload
@@ -226,17 +226,17 @@ RSpec.describe 'Moving a work package through Rails view', js: true do
it 'displays an error message explaining which work package could not be moved and why' do
expect(page)
- .to have_selector('.flash.error',
+ .to have_selector('.op-toast.-error',
text: I18n.t('work_packages.bulk.could_not_be_saved'))
expect(page)
.to have_selector(
- '.flash.error',
+ '.op-toast.-error',
text: "#{work_package2.id}: Project #{I18n.t('activerecord.errors.messages.error_readonly')}"
)
expect(page)
- .to have_selector('.flash.error',
+ .to have_selector('.op-toast.-error',
text: I18n.t('work_packages.bulk.x_out_of_y_could_be_saved',
failing: 1,
total: 2,