Commit a080a18d authored by Scott Stern's avatar Scott Stern Committed by Brandon Labuschagne

Fix sort for milestones in filtered search

parent 9f4a28ae
query GroupBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) { query GroupBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) {
group(fullPath: $fullPath) { group(fullPath: $fullPath) {
id id
milestones(includeAncestors: true, searchTitle: $searchTerm, state: $state) { milestones(
includeAncestors: true
searchTitle: $searchTerm
state: $state
sort: EXPIRED_LAST_DUE_DATE_ASC
) {
nodes { nodes {
id id
title title
......
query ProjectBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) { query ProjectBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) {
project(fullPath: $fullPath) { project(fullPath: $fullPath) {
id id
milestones(searchTitle: $searchTerm, includeAncestors: true, state: $state) { milestones(
searchTitle: $searchTerm
includeAncestors: true
state: $state
sort: EXPIRED_LAST_DUE_DATE_ASC
) {
nodes { nodes {
id id
title title
......
...@@ -7,8 +7,8 @@ RSpec.describe 'Issue board filters', :js do ...@@ -7,8 +7,8 @@ RSpec.describe 'Issue board filters', :js do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:board) { create(:board, project: project) } let_it_be(:board) { create(:board, project: project) }
let_it_be(:project_label) { create(:label, project: project, title: 'Label') } let_it_be(:project_label) { create(:label, project: project, title: 'Label') }
let_it_be(:milestone_1) { create(:milestone, project: project) } let_it_be(:milestone_1) { create(:milestone, project: project, due_date: 3.days.from_now ) }
let_it_be(:milestone_2) { create(:milestone, project: project) } let_it_be(:milestone_2) { create(:milestone, project: project, due_date: Date.tomorrow ) }
let_it_be(:release) { create(:release, tag: 'v1.0', project: project, milestones: [milestone_1]) } let_it_be(:release) { create(:release, tag: 'v1.0', project: project, milestones: [milestone_1]) }
let_it_be(:release_2) { create(:release, tag: 'v2.0', project: project, milestones: [milestone_2]) } let_it_be(:release_2) { create(:release, tag: 'v2.0', project: project, milestones: [milestone_2]) }
let_it_be(:issue_1) { create(:issue, project: project, milestone: milestone_1, author: user) } let_it_be(:issue_1) { create(:issue, project: project, milestone: milestone_1, author: user) }
...@@ -134,8 +134,11 @@ RSpec.describe 'Issue board filters', :js do ...@@ -134,8 +134,11 @@ RSpec.describe 'Issue board filters', :js do
expect(filter_dropdown).to have_content('Any') expect(filter_dropdown).to have_content('Any')
expect(filter_dropdown).to have_content('Started') expect(filter_dropdown).to have_content('Started')
expect(filter_dropdown).to have_content('Upcoming') expect(filter_dropdown).to have_content('Upcoming')
expect(filter_dropdown).to have_content(milestone_1.title)
expect(filter_dropdown).to have_content(milestone_2.title) dropdown_nodes = page.find_all('.gl-filtered-search-suggestion-list > .gl-filtered-search-suggestion')
expect(dropdown_nodes[4]).to have_content(milestone_2.title)
expect(dropdown_nodes.last).to have_content(milestone_1.title)
click_on milestone_1.title click_on milestone_1.title
filter_submit.click filter_submit.click
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment