Skip to content
代码片段 群组 项目
提交 cd2c7262 编辑于 作者: Ezekiel Kigbo's avatar Ezekiel Kigbo 提交者: Brandon Labuschagne
浏览文件

Add feature spec for group transfer settings

Updates the group settings spec to include tests
for transferring a subgroup or a root level group
to another namespace
上级 c8780dfb
No related branches found
No related tags found
无相关合并请求
...@@ -64,6 +64,7 @@ export default { ...@@ -64,6 +64,7 @@ export default {
:empty-namespace-title="$options.i18n.emptyNamespaceTitle" :empty-namespace-title="$options.i18n.emptyNamespaceTitle"
:include-headers="false" :include-headers="false"
include-empty-namespace include-empty-namespace
data-testid="transfer-group-namespace-select"
@select="handleSelected" @select="handleSelected"
/> />
<input type="hidden" name="new_parent_group_id" :value="selectedId" /> <input type="hidden" name="new_parent_group_id" :value="selectedId" />
......
...@@ -138,6 +138,51 @@ ...@@ -138,6 +138,51 @@
end end
end end
describe 'transfer group', :js do
let(:namespace_select) { page.find('[data-testid="transfer-group-namespace-select"]') }
let(:confirm_modal) { page.find('[data-testid="confirm-danger-modal"]') }
shared_examples 'can transfer the group' do
before do
selected_group.add_owner(user)
end
it 'can successfully transfer the group' do
visit edit_group_path(selected_group)
page.within('.js-group-transfer-form') do
namespace_select.find('button').click
namespace_select.find('.dropdown-menu p', text: target_group_name, match: :first).click
click_button "Transfer group"
end
page.within(confirm_modal) do
expect(page).to have_text "You are going to transfer #{selected_group.name} to another namespace. Are you ABSOLUTELY sure? "
fill_in "confirm_name_input", with: selected_group.name
click_button "Confirm"
end
expect(page).to have_text "Group '#{selected_group.name}' was successfully transferred."
end
end
context 'with a sub group' do
let(:selected_group) { create(:group, path: 'foo-subgroup', parent: group) }
let(:target_group_name) { "No parent group" }
it_behaves_like 'can transfer the group'
end
context 'with a root group' do
let(:selected_group) { create(:group, path: 'foo-rootgroup') }
let(:target_group_name) { group.name }
it_behaves_like 'can transfer the group'
end
end
context 'disable email notifications' do context 'disable email notifications' do
it 'is visible' do it 'is visible' do
visit edit_group_path(group) visit edit_group_path(group)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册