Skip to content

Commit

Permalink
use existing helpers when available
Browse files Browse the repository at this point in the history
  • Loading branch information
EinLama committed Oct 23, 2024
1 parent 1bd1ae2 commit bc2f0d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 6 additions & 2 deletions spec/features/work_packages/edit_work_package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ def visit!
context "when using the user auto completer" do
RSpec.shared_examples "without permission" do |field_name|
it "does not show you the email of other users" do
wp_page.open_user_auto_completer(field_name)
completer = wp_page.edit_field field_name
completer.activate!

options = wp_page.visible_user_auto_completer_options

expected_options = [
Expand All @@ -281,7 +283,9 @@ def visit!

RSpec.shared_examples "with permission" do |field_name|
it "does show you the email of other users" do
wp_page.open_user_auto_completer(field_name)
completer = wp_page.edit_field field_name
completer.activate!

options = wp_page.visible_user_auto_completer_options

expected_options = [
Expand Down
4 changes: 0 additions & 4 deletions spec/support/pages/work_packages/abstract_work_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,6 @@ def mark_notifications_as_read
find('[data-test-selector="mark-notification-read-button"]').click
end

def open_user_auto_completer(field = "assignee")
find("op-editable-attribute-field[ng-reflect-field-name='#{field}'] [role='button']", wait: 10).click
end

# Finds the currently visible, expanded user auto completer and returns its dropdown menu options.
# A user always has a name, but their email is only visible in certain circumstances, so that value
# might be nil.
Expand Down

0 comments on commit bc2f0d0

Please sign in to comment.