Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-30 21:11:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-30 21:11:38 +0300
commit4534d890f1e1d198804e9e2ff0da76e2308ebe23 (patch)
tree3538a50326d2fd52dd1545cc0a387e24a2877fe4 /spec/graphql
parentd0713b807555cbd970ce712d5c0812daee371e2b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
-rw-r--r--spec/graphql/types/group_type_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/graphql/types/group_type_spec.rb b/spec/graphql/types/group_type_spec.rb
index 6622551f063..d3f9053faf3 100644
--- a/spec/graphql/types/group_type_spec.rb
+++ b/spec/graphql/types/group_type_spec.rb
@@ -125,4 +125,37 @@ RSpec.describe GitlabSchema.types['Group'] do
expect { clean_state_query }.not_to exceed_all_query_limit(control)
end
end
+
+ describe 'custom emoji' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:group) { create(:group) }
+ let_it_be(:subgroup) { create(:group, parent: group) }
+ let_it_be(:custom_emoji) { create(:custom_emoji, group: group) }
+ let_it_be(:custom_emoji_subgroup) { create(:custom_emoji, group: subgroup) }
+ let(:query) do
+ %(
+ query {
+ group(fullPath: "#{subgroup.full_path}") {
+ customEmoji(includeAncestorGroups: true) {
+ nodes {
+ id
+ }
+ }
+ }
+ }
+ )
+ end
+
+ before_all do
+ group.add_reporter(user)
+ end
+
+ describe 'when includeAncestorGroups is true' do
+ it 'returns emoji from ancestor groups' do
+ result = GitlabSchema.execute(query, context: { current_user: user }).as_json
+
+ expect(result.dig('data', 'group', 'customEmoji', 'nodes').count).to eq(2)
+ end
+ end
+ end
end