diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 18:09:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 18:09:12 +0300 |
commit | e2937892231e082f4981c31e25cb8d1cca36ea60 (patch) | |
tree | a543551ce5980395b9ee826c78e83d4d9c1ae9d4 /spec/graphql/types | |
parent | fdb953945da752dc52c1957f64a179de39f507e5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql/types')
-rw-r--r-- | spec/graphql/types/user_callout_feature_name_enum_spec.rb | 11 | ||||
-rw-r--r-- | spec/graphql/types/user_callout_type_spec.rb | 11 | ||||
-rw-r--r-- | spec/graphql/types/user_type_spec.rb | 9 |
3 files changed, 31 insertions, 0 deletions
diff --git a/spec/graphql/types/user_callout_feature_name_enum_spec.rb b/spec/graphql/types/user_callout_feature_name_enum_spec.rb new file mode 100644 index 00000000000..28755e1301b --- /dev/null +++ b/spec/graphql/types/user_callout_feature_name_enum_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['UserCalloutFeatureNameEnum'] do + specify { expect(described_class.graphql_name).to eq('UserCalloutFeatureNameEnum') } + + it 'exposes all the existing user callout feature names' do + expect(described_class.values.keys).to match_array(::UserCallout.feature_names.keys.map(&:upcase)) + end +end diff --git a/spec/graphql/types/user_callout_type_spec.rb b/spec/graphql/types/user_callout_type_spec.rb new file mode 100644 index 00000000000..b26b85a4e8b --- /dev/null +++ b/spec/graphql/types/user_callout_type_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['UserCallout'] do + specify { expect(described_class.graphql_name).to eq('UserCallout') } + + it 'has expected fields' do + expect(described_class).to have_graphql_fields(:feature_name, :dismissed_at) + end +end diff --git a/spec/graphql/types/user_type_spec.rb b/spec/graphql/types/user_type_spec.rb index 5b3662383d8..d9e67ff348b 100644 --- a/spec/graphql/types/user_type_spec.rb +++ b/spec/graphql/types/user_type_spec.rb @@ -31,6 +31,7 @@ RSpec.describe GitlabSchema.types['User'] do groupCount projectMemberships starredProjects + callouts ] expect(described_class).to have_graphql_fields(*expected_fields) @@ -44,4 +45,12 @@ RSpec.describe GitlabSchema.types['User'] do is_expected.to have_graphql_resolver(Resolvers::Users::SnippetsResolver) end end + + describe 'callouts field' do + subject { described_class.fields['callouts'] } + + it 'returns user callouts' do + is_expected.to have_graphql_type(Types::UserCalloutType.connection_type) + end + end end |