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

Fix projects index spec not taking over the sort

Oliver Güntheradae1106e724
diff --git a/frontend/src/app/core/augmenting/dynamic-scripts/project.js b/frontend/src/app/core/augmenting/dynamic-scripts/project.js
index c13bc19b3f9..9dc625aa2bd 100644
--- a/frontend/src/app/core/augmenting/dynamic-scripts/project.js
+++ b/frontend/src/app/core/augmenting/dynamic-scripts/project.js
@@ -134,7 +134,7 @@ jQuery(function ($) {
function sendForm() {
$('#ajax-indicator').show();
let filters = parseFilters();
- let orderParam = getUrlParameter('sort');
+ let orderParam = getUrlParameter('sortBy');
let query = '?filters=' + encodeURIComponent(JSON.stringify(filters));
diff --git a/spec/features/projects/projects_index_spec.rb b/spec/features/projects/projects_index_spec.rb
index 9f7a9522e87..bd9d926321a 100644
--- a/spec/features/projects/projects_index_spec.rb
+++ b/spec/features/projects/projects_index_spec.rb
@@ -291,6 +291,7 @@ describe 'Projects index page',
expect(page).to have_no_text(project.name) # Filtered away
expect(page).to have_no_text('Next') # Filters kept active, so there is no third page.
expect(page).to have_no_text(public_project.name) # That one should be on page 1
+ expect(page).to have_selector('.sort.desc', text: 'NAME')
# Sending the filter form again what implies to compose the request freshly
SeleniumHubWaiter.wait
@@ -302,6 +303,7 @@ describe 'Projects index page',
expect(page).to have_no_text(development_project.name) # as it is on the second page
expect(page).to have_no_text(project.name) # as it filtered away
expect(page).to have_text('Next') # as the result set is larger than 1
+ expect(page).to have_selector('.sort.desc', text: 'NAME')
end
end