From 972573e35183c50de37ce7eec1346f20a23bfca1 Mon Sep 17 00:00:00 2001 From: Tomislav Nikic Date: Sat, 27 Jul 2019 04:23:34 +0000 Subject: Adding changes to CE from EE All the changes done to files that are also inside CE and need to be ported. --- .../javascripts/diffs/components/diff_discussion_reply.vue | 1 - app/assets/javascripts/diffs/components/diff_file_header.vue | 1 + .../javascripts/notes/components/discussion_actions.vue | 2 +- app/assets/javascripts/notes/components/note_form.vue | 8 ++++++-- app/views/projects/merge_requests/show.html.haml | 2 +- qa/qa/page/component/note.rb | 12 ++++++++++-- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/diffs/components/diff_discussion_reply.vue b/app/assets/javascripts/diffs/components/diff_discussion_reply.vue index 2aa5e9b3339..531ebaddacd 100644 --- a/app/assets/javascripts/diffs/components/diff_discussion_reply.vue +++ b/app/assets/javascripts/diffs/components/diff_discussion_reply.vue @@ -44,7 +44,6 @@ export default { class="d-none d-sm-block" /> diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 4b226e30699..32fbeaaa905 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -263,6 +263,7 @@ export default { :disabled="!diffHasDiscussions(diffFile)" :class="{ active: hasExpandedDiscussions }" class="js-btn-vue-toggle-comments btn" + data-qa-selector="toggle_comments_button" type="button" @click="handleToggleDiscussions" > diff --git a/app/assets/javascripts/notes/components/discussion_actions.vue b/app/assets/javascripts/notes/components/discussion_actions.vue index 7aa8580d794..edab750b572 100644 --- a/app/assets/javascripts/notes/components/discussion_actions.vue +++ b/app/assets/javascripts/notes/components/discussion_actions.vue @@ -41,8 +41,8 @@ export default { diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index 2084ca6f905..2c5c5141bf0 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -32,7 +32,7 @@ .merge-request-tabs-holder{ class: ("js-tabs-affix" unless ENV['RAILS_ENV'] == 'test') } .merge-request-tabs-container %ul.merge-request-tabs.nav-tabs.nav.nav-links - %li.notes-tab.qa-notes-tab + %li.notes-tab{ data: { qa_selector: 'notes_tab'} } = tab_link_for @merge_request, :show, force_link: @commit.present? do = _("Discussion") %span.badge.badge-pill= @merge_request.related_notes.user.count diff --git a/qa/qa/page/component/note.rb b/qa/qa/page/component/note.rb index fe324574f4d..34fde045091 100644 --- a/qa/qa/page/component/note.rb +++ b/qa/qa/page/component/note.rb @@ -20,13 +20,17 @@ module QA end base.view 'app/assets/javascripts/notes/components/discussion_actions.vue' do - element :discussion_reply + element :discussion_reply_tab end base.view 'app/assets/javascripts/notes/components/toggle_replies_widget.vue' do element :expand_replies element :collapse_replies end + + base.view 'app/assets/javascripts/diffs/components/diff_file_header.vue' do + element :toggle_comments_button + end end def start_discussion(text) @@ -36,8 +40,12 @@ module QA click_element :comment_button end + def toggle_comments + all_elements(:toggle_comments_button).last.click + end + def type_reply_to_discussion(reply_text) - all_elements(:discussion_reply).last.click + all_elements(:discussion_reply_tab).last.click fill_element :reply_input, reply_text end -- cgit v1.2.1