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

Adapt tests to icon-only toolbar

Henriette Darge61ab3a45c4de
diff --git a/spec/features/work_packages/details/details_toolbar_spec.rb b/spec/features/work_packages/details/details_toolbar_spec.rb
index c7babaec5fb..b5be014a130 100644
--- a/spec/features/work_packages/details/details_toolbar_spec.rb
+++ b/spec/features/work_packages/details/details_toolbar_spec.rb
@@ -44,15 +44,15 @@ RSpec.describe "Work package details toolbar", :js, :selenium do
it "toggles the watch state" do
expect(work_package.watcher_users).not_to include(user)
- expect(page).to have_css(".work-packages--details-toolbar button", text: "Watch")
+ expect(page).to have_css(".work-packages--details-toolbar button[title='Watch work package']")
within ".work-packages--details-toolbar" do
click_button "Watch"
end
- expect(page).to have_css(".work-packages--details-toolbar button", text: "Unwatch")
+ expect(page).to have_css(".work-packages--details-toolbar button[title='Unwatch work package']")
expect(work_package.reload.watcher_users).to include(user)
- expect(page).to have_css(".work-packages--details-toolbar button", text: "Unwatch")
+ expect(page).to have_css(".work-packages--details-toolbar button[title='Unwatch work package']")
end
end
end
diff --git a/spec/features/work_packages/tabs/watcher_tab_spec.rb b/spec/features/work_packages/tabs/watcher_tab_spec.rb
index debd55015ae..20e626373d5 100644
--- a/spec/features/work_packages/tabs/watcher_tab_spec.rb
+++ b/spec/features/work_packages/tabs/watcher_tab_spec.rb
@@ -26,13 +26,13 @@ RSpec.describe "Watcher tab", :js, :selenium, :with_cuprite do
def expect_button_is_watching
title = I18n.t("js.label_unwatch_work_package")
expect(page).to have_css("#unwatch-button[title='#{title}']", wait: 10)
- expect(page).to have_css("#unwatch-button .button--icon.icon-watched", wait: 10)
+ expect(page).to have_css("#unwatch-button .button--icon[eye-icon]", wait: 10)
end
def expect_button_is_not_watching
title = I18n.t("js.label_watch_work_package")
expect(page).to have_css("#watch-button[title='#{title}']")
- expect(page).to have_css("#watch-button .button--icon.icon-unwatched")
+ expect(page).to have_css("#watch-button .button--icon[eye-closed-icon]")
end
shared_examples "watch and unwatch with button" do