summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-07-19 02:00:15 +0300
committerFatih Acet <acetfatih@gmail.com>2016-07-21 19:55:16 +0300
commitd997109482136bda30744f56ea2cd4aba2b45848 (patch)
treeab92c2d858fa181f9c4e6e2c8ff48014ff54a2f2
parent0b3369f8bf18a5382c82e4099ce206b3e37858fe (diff)
downloadgitlab-ce-diff-options.tar.gz
Spec fixes for removed UI elements.diff-options
-rw-r--r--app/views/projects/diffs/_diffs.html.haml6
-rw-r--r--features/project/merge_requests.feature9
-rw-r--r--features/steps/project/merge_requests.rb14
-rw-r--r--spec/features/expand_collapse_diffs_spec.rb3
4 files changed, 17 insertions, 15 deletions
diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml
index 0539fb4e6d1..a2092d01cda 100644
--- a/app/views/projects/diffs/_diffs.html.haml
+++ b/app/views/projects/diffs/_diffs.html.haml
@@ -11,7 +11,7 @@
%span.caret
%ul.dropdown-menu
%li
- %a.is-unselectable.js-diff-comments-button{ href: "#", data: { state: "visible" } }
+ %a.js-diff-comments-button{ href: "#", data: { state: "visible" } }
Hide all comments
%li
- if show_whitespace_toggle
@@ -20,10 +20,10 @@
- elsif current_controller?(:merge_requests)
= diff_merge_request_whitespace_link(@project, @merge_request, {})
- elsif current_controller?(:compare)
- = diff_compare_whitespace_link(@project, params[:from], params[:to])
+ = diff_compare_whitespace_link(@project, params[:from], params[:to], {})
%li
- if !expand_all_diffs? && diff_files.any? { |diff_file| diff_file.collapsed? }
- = link_to 'Expand all', url_for(params.merge(expand_all_diffs: 1, format: 'html')), class: 'is-unselectable'
+ = link_to 'Expand all', url_for(params.merge(expand_all_diffs: 1, format: 'html')), {class: 'expand-all'}
.btn-group
= inline_diff_btn
= parallel_diff_btn
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index 21768c15c17..c1d4ec822eb 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -194,7 +194,7 @@ Feature: Project Merge Requests
And I visit merge request page "Bug NS-05"
And I click on the Changes tab
And I leave a comment like "Line is wrong" on line 39 of the third file
- And I click link "Hide inline discussion" of the third file
+ And I click link "Hide inline discussion" button
Then I should not see a comment like "Line is wrong here" in the third file
@javascript
@@ -212,9 +212,8 @@ Feature: Project Merge Requests
And I click on the Changes tab
And I leave a comment like "Line is correct" on line 12 of the second file
And I leave a comment like "Line is wrong" on line 39 of the third file
- And I click link "Hide inline discussion" of the third file
+ And I click link "Hide inline discussion" button
Then I should not see a comment like "Line is wrong here" in the third file
- And I should still see a comment like "Line is correct" in the second file
@javascript
Scenario: I show comments on a merge request diff with comments in multiple files
@@ -223,8 +222,8 @@ Feature: Project Merge Requests
And I click on the Changes tab
And I leave a comment like "Line is correct" on line 12 of the second file
And I leave a comment like "Line is wrong" on line 39 of the third file
- And I click link "Hide inline discussion" of the third file
- And I click link "Show inline discussion" of the third file
+ And I click link "Hide inline discussion" button
+ And I click link "Show inline discussion" button
Then I should see a comment like "Line is wrong" in the third file
And I should still see a comment like "Line is correct" in the second file
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index da848afd48e..77602646d06 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -401,15 +401,17 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
end
- step 'I click link "Hide inline discussion" of the third file' do
- page.within '.files [id^=diff]:nth-child(3)' do
- find('.js-toggle-diff-comments').trigger('click')
+ step 'I click link "Hide inline discussion" button' do
+ page.within '#diffs' do
+ find('.inline-parallel-buttons [data-toggle=dropdown]').trigger('click')
+ find('.js-diff-comments-button').trigger('click')
end
end
- step 'I click link "Show inline discussion" of the third file' do
- page.within '.files [id^=diff]:nth-child(3)' do
- find('.js-toggle-diff-comments').trigger('click')
+ step 'I click link "Show inline discussion" button' do
+ page.within '#diffs' do
+ find('.inline-parallel-buttons [data-toggle=dropdown]').trigger('click')
+ find('.js-diff-comments-button').trigger('click')
end
end
diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb
index 688f68d3cff..853441426db 100644
--- a/spec/features/expand_collapse_diffs_spec.rb
+++ b/spec/features/expand_collapse_diffs_spec.rb
@@ -210,7 +210,8 @@ feature 'Expand and collapse diffs', js: true, feature: true do
context 'expanding all diffs' do
before do
- click_link('Expand all')
+ find('.inline-parallel-buttons [data-toggle=dropdown]').trigger('click')
+ find('.inline-parallel-buttons .expand-all').trigger('click')
wait_for_ajax
execute_script('window.ajaxUris = []; $(document).ajaxSend(function(event, xhr, settings) { ajaxUris.push(settings.url) });')
end