summaryrefslogtreecommitdiff
path: root/spec/features/snippets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-13 15:08:52 +0000
commit0ab47b994caa80c5587f33dc818626b66cfdafe2 (patch)
tree5ef3976d2f84e3368903a67ba2dbd87a74b9a43c /spec/features/snippets
parent1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (diff)
downloadgitlab-ce-0ab47b994caa80c5587f33dc818626b66cfdafe2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/snippets')
-rw-r--r--spec/features/snippets/spam_snippets_spec.rb8
-rw-r--r--spec/features/snippets/user_creates_snippet_spec.rb10
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/features/snippets/spam_snippets_spec.rb b/spec/features/snippets/spam_snippets_spec.rb
index 0c3ca6f17c8..dac36ba2b28 100644
--- a/spec/features/snippets/spam_snippets_spec.rb
+++ b/spec/features/snippets/spam_snippets_spec.rb
@@ -5,6 +5,10 @@ require 'spec_helper'
describe 'User creates snippet', :js do
let(:user) { create(:user) }
+ def description_field
+ find('.js-description-input input,textarea')
+ end
+
before do
stub_feature_flags(allow_possible_spam: false)
stub_feature_flags(snippets_vue: false)
@@ -22,7 +26,11 @@ describe 'User creates snippet', :js do
visit new_snippet_path
fill_in 'personal_snippet_title', with: 'My Snippet Title'
+
+ # Click placeholder first to expand full description field
+ description_field.click
fill_in 'personal_snippet_description', with: 'My Snippet **Description**'
+
find('#personal_snippet_visibility_level_20').set(true)
page.within('.file-editor') do
find('.ace_text-input', visible: false).send_keys 'Hello World!'
diff --git a/spec/features/snippets/user_creates_snippet_spec.rb b/spec/features/snippets/user_creates_snippet_spec.rb
index b373264bbe4..eb55613b954 100644
--- a/spec/features/snippets/user_creates_snippet_spec.rb
+++ b/spec/features/snippets/user_creates_snippet_spec.rb
@@ -13,9 +13,17 @@ describe 'User creates snippet', :js do
visit new_snippet_path
end
+ def description_field
+ find('.js-description-input input,textarea')
+ end
+
def fill_form
fill_in 'personal_snippet_title', with: 'My Snippet Title'
+
+ # Click placeholder first to expand full description field
+ description_field.click
fill_in 'personal_snippet_description', with: 'My Snippet **Description**'
+
page.within('.file-editor') do
find('.ace_text-input', visible: false).send_keys 'Hello World!'
end
@@ -36,6 +44,8 @@ describe 'User creates snippet', :js do
end
it 'previews a snippet with file' do
+ # Click placeholder first to expand full description field
+ description_field.click
fill_in 'personal_snippet_description', with: 'My Snippet'
dropzone_file Rails.root.join('spec', 'fixtures', 'banana_sample.gif')
find('.js-md-preview-button').click