summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/features/packages_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/features/packages_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/features/packages_shared_examples.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/spec/support/shared_examples/features/packages_shared_examples.rb b/spec/support/shared_examples/features/packages_shared_examples.rb
index 96be30b9f1f..d14b4638ca5 100644
--- a/spec/support/shared_examples/features/packages_shared_examples.rb
+++ b/spec/support/shared_examples/features/packages_shared_examples.rb
@@ -21,10 +21,6 @@ end
RSpec.shared_examples 'package details link' do |property|
let(:package) { packages.first }
- before do
- stub_feature_flags(packages_details_one_column: false)
- end
-
it 'navigates to the correct url' do
page.within(packages_table_selector) do
click_link package.name
@@ -32,7 +28,7 @@ RSpec.shared_examples 'package details link' do |property|
expect(page).to have_current_path(project_package_path(package.project, package))
- expect(page).to have_css('.packages-app h1[data-testid="title"]', text: package.name)
+ expect(page).to have_css('.packages-app h2[data-testid="title"]', text: package.name)
expect(page).to have_content('Installation')
expect(page).to have_content('Registry setup')
@@ -94,16 +90,24 @@ def packages_table_selector
end
def click_sort_option(option, ascending)
- page.within('.gl-sorting') do
- # Reset the sort direction
- click_button 'Sort direction' if page.has_selector?('svg[aria-label="Sorting Direction: Ascending"]', wait: 0)
+ wait_for_requests
- find('button.gl-dropdown-toggle').click
+ # Reset the sort direction
+ if page.has_selector?('button[aria-label="Sorting Direction: Ascending"]', wait: 0) && !ascending
+ click_button 'Sort direction'
- page.within('.dropdown-menu') do
- click_button option
- end
+ wait_for_requests
+ end
+
+ find('button.gl-dropdown-toggle').click
+
+ page.within('.dropdown-menu') do
+ click_button option
+ end
+
+ if ascending
+ wait_for_requests
- click_button 'Sort direction' if ascending
+ click_button 'Sort direction'
end
end