Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-07 03:09:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-07 03:09:26 +0300
commit418a39f6c20ebaf9572c4ef3ae924b0c6ffc5e3b (patch)
treec4ae73eee4e0a2ba535e87893858d9e76778d09d /spec/features/protected_branches_spec.rb
parent2633d5ef5ed868eccb174c6ff644a3fb8224f990 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/protected_branches_spec.rb')
-rw-r--r--spec/features/protected_branches_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index eb099359df9..a88dc9f8655 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -22,6 +22,7 @@ RSpec.describe 'Protected Branches', :js do
end
it 'does not allow developer to removes protected branch' do
+ stub_feature_flags(gldropdown_branches: false)
visit project_branches_path(project)
fill_in 'branch-search', with: 'fix'
@@ -29,6 +30,17 @@ RSpec.describe 'Protected Branches', :js do
expect(page).to have_css('.btn-danger.disabled')
end
+
+ context 'with gldropdown_branches enabled' do
+ it 'does not allow developer to removes protected branch' do
+ visit project_branches_path(project)
+
+ find('input[data-testid="branch-search"]').set('fix')
+ find('input[data-testid="branch-search"]').native.send_keys(:enter)
+
+ expect(page).to have_css('.btn-danger.disabled')
+ end
+ end
end
end
@@ -45,6 +57,7 @@ RSpec.describe 'Protected Branches', :js do
end
it 'removes branch after modal confirmation' do
+ stub_feature_flags(gldropdown_branches: false)
visit project_branches_path(project)
fill_in 'branch-search', with: 'fix'
@@ -63,6 +76,28 @@ RSpec.describe 'Protected Branches', :js do
expect(page).to have_content('No branches to show')
end
+
+ context 'with gldropdown_branches enabled' do
+ it 'removes branch after modal confirmation' do
+ visit project_branches_path(project)
+
+ find('input[data-testid="branch-search"]').set('fix')
+ find('input[data-testid="branch-search"]').native.send_keys(:enter)
+
+ expect(page).to have_content('fix')
+ expect(find('.all-branches')).to have_selector('li', count: 1)
+ page.find('[data-target="#modal-delete-branch"]').click
+
+ expect(page).to have_css('.js-delete-branch[disabled]')
+ fill_in 'delete_branch_input', with: 'fix'
+ click_link 'Delete protected branch'
+
+ find('input[data-testid="branch-search"]').set('fix')
+ find('input[data-testid="branch-search"]').native.send_keys(:enter)
+
+ expect(page).to have_content('No branches to show')
+ end
+ end
end
end