Commit 7b48be3a authored by charlie ablett's avatar charlie ablett

Address reviewer feedback

- Add field and argument tests
- Remove unneeded test
- Restore removed argument
parent 960a5bd7
......@@ -8976,6 +8976,11 @@ input EpicBoardCreateInput {
"""
clientMutationId: String
"""
Full path of the group with which the resource is associated.
"""
groupPath: ID
"""
Whether or not backlog list is hidden.
"""
......
......@@ -24847,6 +24847,16 @@
},
"defaultValue": null
},
{
"name": "groupPath",
"description": "Full path of the group with which the resource is associated.",
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
......@@ -11,6 +11,10 @@ module Mutations
authorize :admin_epic_board
argument :group_path, GraphQL::ID_TYPE,
required: false,
description: 'Full path of the group with which the resource is associated.'
field :epic_board,
Types::Boards::EpicBoardType,
null: true,
......
......@@ -20,6 +20,13 @@ RSpec.describe ::Mutations::Boards::EpicBoards::Create do
end
end
context 'field tests' do
subject { described_class }
it { is_expected.to have_graphql_arguments(:groupPath, :name, :hideBacklogList, :hideClosedList) }
it { is_expected.to have_graphql_fields(:epic_board).at_least }
end
context 'with epic feature enabled and epic_boards feature flag enabled' do
before do
stub_licensed_features(epics: true)
......
......@@ -8,16 +8,14 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
end
let(:parent) { create(:group) }
let(:epics_enabled) { false }
let(:epic_boards_enabled) { false }
before do
stub_licensed_features(epics: epics_enabled)
stub_feature_flags(epic_boards: epic_boards_enabled)
end
shared_examples 'does not create a board' do
specify do
context 'with epic boards feature not available' do
it 'does not create a board' do
service = described_class.new(parent, double)
expect(service.execute.payload).not_to be_nil
......@@ -25,19 +23,9 @@ RSpec.describe Boards::EpicBoards::CreateService, services: true do
end
end
context 'With epics feature available' do
let(:epics_enabled) { true }
it_behaves_like 'does not create a board'
context 'with epic boards feature available' do
let(:epic_boards_enabled) { true }
it_behaves_like 'create a board', :epic_boards
end
end
context 'with epics feature not available' do
it_behaves_like 'does not create a board'
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment