diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-17 15:10:53 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-17 15:10:53 +0300 |
commit | 2724004cd7b8fa9d179c926c62f2fd7be63c2d81 (patch) | |
tree | 9915474bdea07e9748e3b940de07e899fb5f641c /spec/graphql | |
parent | f665874e9ee6c28d5098248852f07ae7469d8b2b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/graphql')
3 files changed, 51 insertions, 0 deletions
diff --git a/spec/graphql/types/work_items/widget_definition_interface_spec.rb b/spec/graphql/types/work_items/widget_definition_interface_spec.rb new file mode 100644 index 00000000000..6f1fd0cc572 --- /dev/null +++ b/spec/graphql/types/work_items/widget_definition_interface_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::WorkItems::WidgetDefinitionInterface, feature_category: :team_planning do + it 'exposes the expected fields' do + expected_fields = %i[ + type + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end + + describe '.resolve_type' do + subject { described_class.resolve_type(object, {}) } + + context 'for assignees widget' do + let(:object) { WorkItems::Widgets::Assignees } + + it { is_expected.to eq(Types::WorkItems::WidgetDefinitions::AssigneesType) } + end + + context 'for other widgets' do + let(:object) { WorkItems::Widgets::Description } + + it { is_expected.to eq(Types::WorkItems::WidgetDefinitions::GenericType) } + end + end +end diff --git a/spec/graphql/types/work_items/widget_definitions/assignees_type_spec.rb b/spec/graphql/types/work_items/widget_definitions/assignees_type_spec.rb new file mode 100644 index 00000000000..d6179e92c02 --- /dev/null +++ b/spec/graphql/types/work_items/widget_definitions/assignees_type_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::WorkItems::WidgetDefinitions::AssigneesType, feature_category: :team_planning do + it 'exposes the expected fields' do + expected_fields = %i[type can_invite_members] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end diff --git a/spec/graphql/types/work_items/widget_definitions/generic_type_spec.rb b/spec/graphql/types/work_items/widget_definitions/generic_type_spec.rb new file mode 100644 index 00000000000..19e962e71fd --- /dev/null +++ b/spec/graphql/types/work_items/widget_definitions/generic_type_spec.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Types::WorkItems::WidgetDefinitions::GenericType, feature_category: :team_planning do + it 'exposes the expected fields' do + expected_fields = %i[type] + + expect(described_class).to have_graphql_fields(*expected_fields) + end +end |