diff options
Diffstat (limited to 'spec/graphql/types/ci/catalog/resources')
4 files changed, 70 insertions, 0 deletions
diff --git a/spec/graphql/types/ci/catalog/resources/component_type_spec.rb b/spec/graphql/types/ci/catalog/resources/component_type_spec.rb new file mode 100644 index 00000000000..93ab926d406 --- /dev/null +++ b/spec/graphql/types/ci/catalog/resources/component_type_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::Ci::Catalog::Resources::ComponentType, feature_category: :pipeline_composition do + specify { expect(described_class.graphql_name).to eq('CiCatalogResourceComponent') } + + it 'exposes the expected fields' do + expected_fields = %i[ + id + inputs + name + path + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end diff --git a/spec/graphql/types/ci/catalog/resources/components/input_type_spec.rb b/spec/graphql/types/ci/catalog/resources/components/input_type_spec.rb new file mode 100644 index 00000000000..cb716cfff8c --- /dev/null +++ b/spec/graphql/types/ci/catalog/resources/components/input_type_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::Ci::Catalog::Resources::Components::InputType, feature_category: :pipeline_composition do + specify { expect(described_class.graphql_name).to eq('CiCatalogResourceComponentInput') } + + it 'exposes the expected fields' do + expected_fields = %i[ + name + default + required + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end diff --git a/spec/graphql/types/ci/catalog/resources/version_sort_enum_spec.rb b/spec/graphql/types/ci/catalog/resources/version_sort_enum_spec.rb new file mode 100644 index 00000000000..fd0f1a1e553 --- /dev/null +++ b/spec/graphql/types/ci/catalog/resources/version_sort_enum_spec.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GitlabSchema.types['CiCatalogResourceVersionSort'], feature_category: :pipeline_composition do + it { expect(described_class.graphql_name).to eq('CiCatalogResourceVersionSort') } + + it 'exposes all the existing catalog resource version sort options' do + expect(described_class.values.keys).to include( + *%w[RELEASED_AT_ASC RELEASED_AT_DESC CREATED_ASC CREATED_DESC] + ) + end +end diff --git a/spec/graphql/types/ci/catalog/resources/version_type_spec.rb b/spec/graphql/types/ci/catalog/resources/version_type_spec.rb new file mode 100644 index 00000000000..088973cf8f7 --- /dev/null +++ b/spec/graphql/types/ci/catalog/resources/version_type_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::Ci::Catalog::Resources::VersionType, feature_category: :pipeline_composition do + specify { expect(described_class.graphql_name).to eq('CiCatalogResourceVersion') } + + it 'exposes the expected fields' do + expected_fields = %i[ + id + created_at + released_at + tag_name + tag_path + author + commit + components + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end |