Commit f46565b4 authored by Eugenia Grieff's avatar Eugenia Grieff

Add GraphQL mutation tests

parent aeb6a782
---
title: Update epic inherited dates and create notes when reordering in epic tree
merge_request: 39742
author:
type: fixed
......@@ -51,7 +51,7 @@ RSpec.describe 'Updating an epic tree' do
context 'when epic feature is enabled' do
before do
stub_licensed_features(epics: true)
stub_licensed_features(epics: true, subepics: true)
end
context 'when the user does not have permission' do
......@@ -141,6 +141,24 @@ RSpec.describe 'Updating an epic tree' do
expect(mutation_response['errors']).to eq(["The sibling object's parent must match the current parent epic."])
end
end
context 'when the new parent is another epic and subepics feature is disabled' do
let(:new_parent_id) { GitlabSchema.id_from_object(base_epic).to_s }
before do
stub_licensed_features(epics: true, subepics: false)
other_epic = create(:epic, group: group)
epic2.update(parent: other_epic)
end
it_behaves_like 'a mutation that does not update the tree'
it 'returns the error message' do
post_graphql_mutation(mutation, current_user: current_user)
expect(mutation_response['errors']).to eq(['You don\'t have permissions to move the objects.'])
end
end
end
context 'when moving an issue' do
......
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