Commit 266e3179 authored by Coung Ngo's avatar Coung Ngo

Put back deleted :unfiltered_epic_aggregates feature flag test

Put back test since we are just defaulting flags to on
parent 44df1a11
......@@ -135,8 +135,10 @@ module Types
field :descendant_weight_sum, Types::EpicDescendantWeightSumType, null: true, complexity: 10,
description: "Total weight of open and closed issues in the epic and its descendants",
resolve: -> (epic, args, ctx) do
if Feature.enabled?(:unfiltered_epic_aggregates, epic.group, default_enabled: true)
Gitlab::Graphql::Aggregations::Epics::LazyEpicAggregate.new(ctx, epic.id, WEIGHT_SUM)
end
end
field :health_status, Types::EpicHealthStatusType, null: true, complexity: 10,
description: 'Current health status of the epic',
......
......@@ -108,5 +108,53 @@ describe 'Epic aggregates (count and weight)' do
)
end
end
context 'with feature flag disabled' do
before do
stub_feature_flags(unfiltered_epic_aggregates: false)
end
context 'when requesting counts' do
let(:epic_aggregates_query) do
<<~QUERY
nodes {
descendantCounts {
openedEpics
closedEpics
openedIssues
closedIssues
}
}
QUERY
end
it 'uses the DescendantCountService' do
expect(Epics::DescendantCountService).to receive(:new)
post_graphql(query, current_user: current_user)
end
it_behaves_like 'counts properly'
end
context 'when requesting weights' do
let(:epic_aggregates_query) do
<<~QUERY
nodes {
descendantWeightSum {
openedIssues
closedIssues
}
}
QUERY
end
it 'returns nil' do
post_graphql(query, current_user: current_user)
expect(subject).to include(a_hash_including('descendantWeightSum' => nil))
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