Commit 985e85c3 authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch 'ss/fix-milestones-sort-issue' into 'master'

Fix sort for milestones in filtered search

See merge request gitlab-org/gitlab!78422
parents 302b0ec2 a080a18d
query GroupBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) {
group(fullPath: $fullPath) {
id
milestones(includeAncestors: true, searchTitle: $searchTerm, state: $state) {
milestones(
includeAncestors: true
searchTitle: $searchTerm
state: $state
sort: EXPIRED_LAST_DUE_DATE_ASC
) {
nodes {
id
title
......
query ProjectBoardMilestones($fullPath: ID!, $searchTerm: String, $state: MilestoneStateEnum) {
project(fullPath: $fullPath) {
id
milestones(searchTitle: $searchTerm, includeAncestors: true, state: $state) {
milestones(
searchTitle: $searchTerm
includeAncestors: true
state: $state
sort: EXPIRED_LAST_DUE_DATE_ASC
) {
nodes {
id
title
......
......@@ -7,8 +7,8 @@ RSpec.describe 'Issue board filters', :js do
let_it_be(:user) { create(:user) }
let_it_be(:board) { create(:board, project: project) }
let_it_be(:project_label) { create(:label, project: project, title: 'Label') }
let_it_be(:milestone_1) { create(:milestone, project: project) }
let_it_be(:milestone_2) { 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, due_date: Date.tomorrow ) }
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(:issue_1) { create(:issue, project: project, milestone: milestone_1, author: user) }
......@@ -134,8 +134,11 @@ RSpec.describe 'Issue board filters', :js do
expect(filter_dropdown).to have_content('Any')
expect(filter_dropdown).to have_content('Started')
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
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