Commit 46e37c85 authored by Eulyeon Ko's avatar Eulyeon Ko

Apply reviewer suggestions

parent 89de38a6
......@@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
You can sort a list of issues several ways, including by:
- Blocking (descending sort only) **(PREMIUM)**
- Blocking **(PREMIUM)**
- Created date
- Due date
- Label priority
......
......@@ -19,6 +19,7 @@ module EE
description: 'Indicates the issue is blocked.'
field :blocking_count, GraphQL::INT_TYPE, null: false,
method: :blocking_issues_count,
description: 'Count of issues this issue is blocking.'
field :blocked_by_count, GraphQL::INT_TYPE, null: true,
......@@ -48,10 +49,6 @@ module EE
object.weight_available? ? object.weight : nil
end
def blocking_count
object.blocking_issues_count
end
def blocked
::Gitlab::Graphql::Aggregations::Issues::LazyBlockAggregate.new(context, object.id) do |count|
(count || 0) > 0
......
......@@ -66,13 +66,11 @@ RSpec.describe Resolvers::IssuesResolver do
end
context 'when sorting by blocking issues count (ties broken by id in desc order)' do
it 'sorts issues ascending', :aggregate_failures do
expect(issue1.id).to be < (issue2.id)
it 'sorts issues ascending' do
expect(resolve_issues(sort: :blocking_issues_asc).to_a).to eq [issue4, issue2, issue1, issue3]
end
it 'sorts issues descending', :aggregate_failures do
expect(issue1.id).to be < (issue2.id)
it 'sorts issues descending' do
expect(resolve_issues(sort: :blocking_issues_desc).to_a).to eq [issue3, issue2, issue1, issue4]
end
end
......
......@@ -305,13 +305,11 @@ RSpec.describe Resolvers::IssuesResolver do
create(:award_emoji, :upvote, awardable: issue4)
end
it 'sorts issues ascending (ties broken by id in desc order)', :aggregate_failures do
expect(issue1.id).to be < (issue4.id)
it 'sorts issues ascending (ties broken by id in desc order)' do
expect(resolve_issues(sort: :popularity_asc).to_a).to eq([issue3, issue4, issue1, issue2])
end
it 'sorts issues descending (ties broken by id in desc order)', :aggregate_failures do
expect(issue1.id).to be < (issue4.id)
it 'sorts issues descending (ties broken by id in desc order)' do
expect(resolve_issues(sort: :popularity_desc).to_a).to eq([issue2, issue4, issue1, issue3])
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