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-11-24 06:12:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-24 06:12:33 +0300
commit492f99eac8d349e03e22d9c3eed8923b80bcc297 (patch)
tree0d18b29a4086f9f5b4958687b3ee33ef2df8b5c3 /spec/features/projects/ci/editor_spec.rb
parent1c27dcaf69cd0181755172d94c87c823e4d5f069 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/ci/editor_spec.rb')
-rw-r--r--spec/features/projects/ci/editor_spec.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/projects/ci/editor_spec.rb b/spec/features/projects/ci/editor_spec.rb
index 7fe1c63f490..7780fcb9b75 100644
--- a/spec/features/projects/ci/editor_spec.rb
+++ b/spec/features/projects/ci/editor_spec.rb
@@ -52,4 +52,53 @@ RSpec.describe 'Pipeline Editor', :js do
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