From 0dae2d777c3f7c7ceb9e5cc4f38878e2fef947ff Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Fri, 29 Jun 2018 20:29:44 +0300 Subject: [PATCH 1/2] Add title placeholder for new issues --- app/views/shared/issuable/form/_title.html.haml | 2 +- .../unreleased/add-title-placeholder-for-new-issues.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/add-title-placeholder-for-new-issues.yml diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index c35d0b3751f..e49bdec386a 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -6,7 +6,7 @@ %div{ class: div_class } = form.text_field :title, required: true, maxlength: 255, autofocus: true, - autocomplete: 'off', class: 'form-control pad qa-issuable-form-title' + autocomplete: 'off', class: 'form-control pad qa-issuable-form-title', placeholder: _('Title') - if issuable.respond_to?(:work_in_progress?) %p.form-text.text-muted diff --git a/changelogs/unreleased/add-title-placeholder-for-new-issues.yml b/changelogs/unreleased/add-title-placeholder-for-new-issues.yml new file mode 100644 index 00000000000..ce9e3b4ac18 --- /dev/null +++ b/changelogs/unreleased/add-title-placeholder-for-new-issues.yml @@ -0,0 +1,5 @@ +--- +title: Add title placeholder for new issues +merge_request: 20271 +author: George Tsiolis +type: changed From 5870d5e4d481ed1a129d8b35c96b912b809da9d1 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Fri, 29 Jun 2018 20:30:00 +0300 Subject: [PATCH 2/2] Update create issue test to check for input placeholders --- spec/features/projects/issues/user_creates_issue_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/features/projects/issues/user_creates_issue_spec.rb b/spec/features/projects/issues/user_creates_issue_spec.rb index e76f7c5589d..5e8662100c5 100644 --- a/spec/features/projects/issues/user_creates_issue_spec.rb +++ b/spec/features/projects/issues/user_creates_issue_spec.rb @@ -17,6 +17,9 @@ describe "User creates issue" do expect(page).to have_no_content("Assign to") .and have_no_content("Labels") .and have_no_content("Milestone") + + expect(page.find('#issue_title')['placeholder']).to eq 'Title' + expect(page.find('#issue_description')['placeholder']).to eq 'Write a comment or drag your files hereā€¦' end issue_title = "500 error on profile"