2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe GitlabSchema.types['Group'] do
|
2020-05-24 23:13:21 +05:30
|
|
|
specify { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Group) }
|
2019-07-31 22:56:46 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
specify { expect(described_class.graphql_name).to eq('Group') }
|
2019-07-31 22:56:46 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
specify { expect(described_class).to require_graphql_authorizations(:read_group) }
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
it 'has the expected fields' do
|
|
|
|
expected_fields = %w[
|
|
|
|
id name path full_name full_path description description_html visibility
|
|
|
|
lfs_enabled request_access_enabled projects root_storage_statistics
|
|
|
|
web_url avatar_url share_with_group_lock project_creation_level
|
|
|
|
subgroup_creation_level require_two_factor_authentication
|
|
|
|
two_factor_grace_period auto_devops_enabled emails_disabled
|
2020-11-24 15:15:51 +05:30
|
|
|
mentions_disabled parent boards milestones group_members
|
2021-02-22 17:27:13 +05:30
|
|
|
merge_requests container_repositories container_repositories_count
|
2020-03-13 15:44:24 +05:30
|
|
|
]
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
expect(described_class).to include_graphql_fields(*expected_fields)
|
2020-03-13 15:44:24 +05:30
|
|
|
end
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
describe 'boards field' do
|
|
|
|
subject { described_class.fields['boards'] }
|
|
|
|
|
|
|
|
it 'returns boards' do
|
|
|
|
is_expected.to have_graphql_type(Types::BoardType.connection_type)
|
|
|
|
end
|
|
|
|
end
|
2020-06-23 00:09:42 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
describe 'members field' do
|
|
|
|
subject { described_class.fields['groupMembers'] }
|
|
|
|
|
|
|
|
it { is_expected.to have_graphql_type(Types::GroupMemberType.connection_type) }
|
|
|
|
it { is_expected.to have_graphql_resolver(Resolvers::GroupMembersResolver) }
|
|
|
|
end
|
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
it_behaves_like 'a GraphQL type with labels'
|
2019-07-31 22:56:46 +05:30
|
|
|
end
|