diff options
Diffstat (limited to 'spec/graphql/types')
-rw-r--r-- | spec/graphql/types/metrics/dashboard_type_spec.rb | 11 | ||||
-rw-r--r-- | spec/graphql/types/metrics/dashboards/annotation_type_spec.rb | 17 |
2 files changed, 26 insertions, 2 deletions
diff --git a/spec/graphql/types/metrics/dashboard_type_spec.rb b/spec/graphql/types/metrics/dashboard_type_spec.rb index 4795fd77537..76f2b4b8935 100644 --- a/spec/graphql/types/metrics/dashboard_type_spec.rb +++ b/spec/graphql/types/metrics/dashboard_type_spec.rb @@ -7,9 +7,16 @@ describe GitlabSchema.types['MetricsDashboard'] do it 'has the expected fields' do expected_fields = %w[ - path - ] + path annotations + ] expect(described_class).to have_graphql_fields(*expected_fields) end + + describe 'annotations field' do + subject { described_class.fields['annotations'] } + + it { is_expected.to have_graphql_type(Types::Metrics::Dashboards::AnnotationType.connection_type) } + it { is_expected.to have_graphql_resolver(Resolvers::Metrics::Dashboards::AnnotationResolver) } + end end diff --git a/spec/graphql/types/metrics/dashboards/annotation_type_spec.rb b/spec/graphql/types/metrics/dashboards/annotation_type_spec.rb new file mode 100644 index 00000000000..2956a2512eb --- /dev/null +++ b/spec/graphql/types/metrics/dashboards/annotation_type_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe GitlabSchema.types['MetricsDashboardAnnotation'] do + it { expect(described_class.graphql_name).to eq('MetricsDashboardAnnotation') } + + it 'has the expected fields' do + expected_fields = %w[ + description id panel_id starting_at ending_at + ] + + expect(described_class).to have_graphql_fields(*expected_fields) + end + + it { expect(described_class).to require_graphql_authorizations(:read_metrics_dashboard_annotation) } +end |