diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 16:37:47 +0300 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/features/projects/ci | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/features/projects/ci')
-rw-r--r-- | spec/features/projects/ci/editor_spec.rb | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/spec/features/projects/ci/editor_spec.rb b/spec/features/projects/ci/editor_spec.rb index 7fe1c63f490..16cfa9f5f84 100644 --- a/spec/features/projects/ci/editor_spec.rb +++ b/spec/features/projects/ci/editor_spec.rb @@ -51,5 +51,65 @@ RSpec.describe 'Pipeline Editor', :js do expect(page).not_to have_content(default_branch) end end + + it 'displays new branch as selected after commiting on a new branch' do + find('#target-branch-field').set('new_branch', clear: :backspace) + + click_button 'Commit changes' + + page.within('[data-testid="branch-selector"]') do + expect(page).to have_content('new_branch') + expect(page).not_to have_content(default_branch) + end + end + end + + context 'Editor content' do + it 'user can reset their CI configuration' do + click_button 'Collapse' + + page.within('#source-editor-') do + find('textarea').send_keys '123' + end + + # It takes some time after sending keys for the reset + # btn to register the changes inside the editor + sleep 1 + click_button 'Reset' + + expect(page).to have_css('#reset-content') + + page.within('#reset-content') do + click_button 'Reset file' + end + + page.within('#source-editor-') do + expect(page).to have_content('Default Content') + expect(page).not_to have_content('Default Content123') + end + end + + it 'user can cancel reseting their CI configuration' do + click_button 'Collapse' + + page.within('#source-editor-') do + find('textarea').send_keys '123' + end + + # It takes some time after sending keys for the reset + # btn to register the changes inside the editor + sleep 1 + click_button 'Reset' + + expect(page).to have_css('#reset-content') + + page.within('#reset-content') do + click_button 'Cancel' + end + + page.within('#source-editor-') do + expect(page).to have_content('Default Content123') + end + end end end |