Commit 976b020a authored by Sean McGivern's avatar Sean McGivern

Merge branch '31292-milestone-sidebar-display-incorect-number-of-mr-when-minimized' into 'master'

Resolve "Milestone sidebar display incorect number of MR when minimized"

Closes #31292

See merge request !10933
parents 4d4aefc5 55fd112b
......@@ -89,7 +89,7 @@
.sidebar-collapsed-icon
%strong
= icon('exclamation', 'aria-hidden': 'true')
%span= milestone.issues_visible_to_user(current_user).count
%span= milestone.merge_requests.count
.title.hide-collapsed
Merge requests
%span.badge= milestone.merge_requests.count
......
---
title: Fixed milestone sidebar showing incorrect number of MRs when collapsed
merge_request: 10933
author:
......@@ -63,4 +63,28 @@ feature 'Project milestone', :feature do
expect(page).not_to have_content('Assign some issues to this milestone.')
end
end
context 'when project has an issue' do
before do
create(:issue, project: project, milestone: milestone)
visit namespace_project_milestone_path(project.namespace, project, milestone)
end
describe 'the collapsed sidebar' do
before do
find('.milestone-sidebar .gutter-toggle').click
end
it 'shows the total MR and issue counts' do
find('.milestone-sidebar .block', match: :first)
blocks = all('.milestone-sidebar .block')
aggregate_failures 'MR and issue blocks' do
expect(blocks[3]).to have_content 1
expect(blocks[4]).to have_content 0
end
end
end
end
end
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