blob: 3f4b52610ae529d3c0693af71510373381e7a47a (
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
|
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Types::Ci::StatusActionType do
include GraphqlHelpers
specify { expect(described_class.graphql_name).to eq('StatusAction') }
it 'exposes the expected fields' do
expected_fields = %i[
id
buttonTitle
icon
path
method
title
]
expect(described_class).to have_graphql_fields(*expected_fields)
end
describe 'id field' do
it 'correctly renders the field' do
stage = build(:ci_stage, status: :skipped)
status = stage.detailed_status(stage.pipeline.user)
expected_id = "#{stage.class.name}-#{status.id}"
expect(resolve_field('id', status, extras: { parent: status }, arg_style: :internal)).to eq(expected_id)
end
end
end
|