Welcome to mirror list, hosted at ThFree Co, Russian Federation.

timelog_type_spec.rb « types « graphql « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c897a25d10dfc900c30c4906651a3f0662393569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe GitlabSchema.types['Timelog'] do
  let_it_be(:fields) { %i[id spent_at time_spent user issue merge_request note summary userPermissions] }

  it { expect(described_class.graphql_name).to eq('Timelog') }
  it { expect(described_class).to have_graphql_fields(fields) }
  it { expect(described_class).to require_graphql_authorizations(:read_issue) }
  it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Timelog) }

  describe 'user field' do
    subject { described_class.fields['user'] }

    it 'returns user' do
      is_expected.to have_non_null_graphql_type(Types::UserType)
    end
  end

  describe 'issue field' do
    subject { described_class.fields['issue'] }

    it 'returns issue' do
      is_expected.to have_graphql_type(Types::IssueType)
    end
  end

  describe 'merge_request field' do
    subject { described_class.fields['mergeRequest'] }

    it 'returns merge_request' do
      is_expected.to have_graphql_type(Types::MergeRequestType)
    end
  end

  describe 'note field' do
    subject { described_class.fields['note'] }

    it 'returns note' do
      is_expected.to have_graphql_type(Types::Notes::NoteType)
    end
  end
end