diff options
author | Constance Okoghenun <cokoghenun@gitlab.com> | 2018-07-05 11:59:57 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-07-05 11:59:57 +0000 |
commit | 45deb92544c84c51f617c38bc1f1454653c23ce0 (patch) | |
tree | 2c7af5cbbab701685f59093631888a53ed972871 /spec | |
parent | fe695ebd24e59f82d16aba629dd6d117be3ee5bb (diff) | |
download | gitlab-ce-45deb92544c84c51f617c38bc1f1454653c23ce0.tar.gz |
Resolve "When editing a comment in an issue, the preview mode is toggled in the main textarea"
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/issues/user_comments_on_issue_spec.rb | 8 | ||||
-rw-r--r-- | spec/javascripts/vue_shared/components/markdown/header_spec.js | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/features/projects/issues/user_comments_on_issue_spec.rb b/spec/features/projects/issues/user_comments_on_issue_spec.rb index 353f487485d..ba5b80ed04b 100644 --- a/spec/features/projects/issues/user_comments_on_issue_spec.rb +++ b/spec/features/projects/issues/user_comments_on_issue_spec.rb @@ -63,6 +63,14 @@ describe "User comments on issue", :js do page.within(".current-note-edit-form") do fill_in("note[note]", with: comment) + find('textarea').send_keys [:control, :shift, 'p'] + expect(page).to have_selector('.current-note-edit-form .md-preview-holder') + expect(page.find('.current-note-edit-form .md-preview-holder p')).to have_content(comment) + end + + expect(page).to have_selector('.new-note .note-textarea') + + page.within(".current-note-edit-form") do click_button("Save comment") end diff --git a/spec/javascripts/vue_shared/components/markdown/header_spec.js b/spec/javascripts/vue_shared/components/markdown/header_spec.js index 02117638b63..488575df401 100644 --- a/spec/javascripts/vue_shared/components/markdown/header_spec.js +++ b/spec/javascripts/vue_shared/components/markdown/header_spec.js @@ -51,7 +51,7 @@ describe('Markdown field header component', () => { spyOn(vm, '$emit'); $(document).triggerHandler('markdown-preview:show', [ - $('<form><textarea class="markdown-area"></textarea></textarea></form>'), + $('<form><div class="js-vue-markdown-field"><textarea class="markdown-area"></textarea></div></form>'), ]); expect(vm.$emit).not.toHaveBeenCalled(); |