summaryrefslogtreecommitdiff
path: root/spec/lib/bulk_imports/groups/graphql/get_labels_query_spec.rb
blob: 247da200d68e50d6b7448302ce7cf719488b7503 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe BulkImports::Groups::Graphql::GetLabelsQuery do
  describe '#variables' do
    let(:entity) { double(source_full_path: 'test', next_page_for: 'next_page', bulk_import: nil) }
    let(:context) { BulkImports::Pipeline::Context.new(entity) }

    it 'returns query variables based on entity information' do
      expected = { full_path: entity.source_full_path, cursor: entity.next_page_for }

      expect(described_class.variables(context)).to eq(expected)
    end
  end

  describe '#data_path' do
    it 'returns data path' do
      expected = %w[data group labels nodes]

      expect(described_class.data_path).to eq(expected)
    end
  end

  describe '#page_info_path' do
    it 'returns pagination information path' do
      expected = %w[data group labels page_info]

      expect(described_class.page_info_path).to eq(expected)
    end
  end
end