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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
filter search spec
Tobias Dillmannb63e7d7ad424
diff --git a/spec/features/work_packages/table/queries/assignee_filter_spec.rb b/spec/features/work_packages/table/queries/assignee_filter_spec.rbindex 7ac77adc53b..c32766347cf 100644--- a/spec/features/work_packages/table/queries/assignee_filter_spec.rb+++ b/spec/features/work_packages/table/queries/assignee_filter_spec.rb@@ -28,7 +28,9 @@require "spec_helper"-RSpec.describe "Work package filtering by assignee", :js do+RSpec.describe "Work package filtering by assignee", :js, :with_cuprite do+ include Components::Autocompleter::NgSelectAutocompleteHelpers+let(:project) { create(:project) }let(:invisible_project) { create(:project) }let(:wp_table) { Pages::WorkPackagesTable.new(project) }@@ -94,4 +96,58 @@ RSpec.describe "Work package filtering by assignee", :js dowp_table.ensure_work_package_not_listed!(work_package_user_assignee)wp_table.expect_work_package_listed(work_package_placeholder_user_assignee)end++ context "when using the auto completer" do+ context "with no permission to view emails" do+ let!(:global_role) { create(:empty_global_role) }++ it "only shows the email address of the current user" do+ wp_table.visit!+ wp_table.expect_work_package_listed(work_package_user_assignee, work_package_placeholder_user_assignee)++ # toggle open+ filters.open+ filters.add_filter_by("Assignee", "is (OR)", [""])++ autocomplete = find(".advanced-filters--ng-select ng-select")+ target_dropdown = search_autocomplete autocomplete,+ query: "",+ results_selector: "body"++ # Their own email address is visible to users+ expect(target_dropdown).to have_css(".ng-option", text: current_user.firstname)+ expect(target_dropdown).to have_css(".ng-option", text: current_user.mail)++ # Other users email address is invisible+ expect(target_dropdown).to have_css(".ng-option", text: other_user.firstname)+ expect(target_dropdown).to have_no_css(".ng-option", text: other_user.mail)+ end+ end++ context "with permission to view emails" do+ let!(:global_role) { create(:standard_global_role) }++ it "shows the email address of all users" do+ wp_table.visit!+ wp_table.expect_work_package_listed(work_package_user_assignee, work_package_placeholder_user_assignee)++ # toggle open+ filters.open+ filters.add_filter_by("Assignee", "is (OR)", [""])++ autocomplete = find(".advanced-filters--ng-select ng-select")+ target_dropdown = search_autocomplete autocomplete,+ query: "",+ results_selector: "body"++ # Their own email address is visible to users+ expect(target_dropdown).to have_css(".ng-option", text: current_user.firstname)+ expect(target_dropdown).to have_css(".ng-option", text: current_user.mail)++ # Other users email address is invisible+ expect(target_dropdown).to have_css(".ng-option", text: other_user.firstname)+ expect(target_dropdown).to have_css(".ng-option", text: other_user.mail)+ end+ end+ endenddiff --git a/spec/support/components/work_packages/filters.rb b/spec/support/components/work_packages/filters.rbindex 911733b3580..4c3cfbc7ba0 100644--- a/spec/support/components/work_packages/filters.rb+++ b/spec/support/components/work_packages/filters.rb@@ -113,7 +113,7 @@ module Componentsdef expect_loadedSeleniumHubWaiter.wait- expect(filter_button).to have_css(".badge", wait: 2, visible: :all)+ expect(filter_button).to have_css(".badge", wait: 10, visible: :all)enddef add_filter(name)