From af143b3f562aadc7f7cda68722be18224b24fa33 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Mon, 23 Jan 2017 09:33:19 +0000 Subject: [PATCH 1/5] Revert "Merge branch 'revert-a91ff32b' into 'master'" This reverts merge request !8688 --- app/assets/stylesheets/framework/files.scss | 34 +++++++++++++++++++ app/assets/stylesheets/pages/diff.scss | 4 +++ app/views/projects/diffs/_file.html.haml | 2 +- .../projects/diffs/_file_header.html.haml | 6 ++-- .../unreleased/25709-diff-file-overflow.yml | 4 +++ 5 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/25709-diff-file-overflow.yml diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index c51912b4ac4..db1c8da06d0 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -231,3 +231,37 @@ span.idiff { } } } + + +.file-title-flex-parent { + display: flex; + align-items: center; + background-color: $gray-light; + border-bottom: 1px solid $border-color; + padding: 10px $gl-padding; + margin: 0; + border-radius: 3px 3px 0 0; + + > a { + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + color: $gl-text-color; + } + + small { + margin: 0 10px 0 0; + } + + .file-actions { + white-space: nowrap; + + .btn { + padding: 0 10px; + font-size: 13px; + line-height: 28px; + display: inline-block; + } + } +} diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 96ba7c40634..8b784c2a439 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -37,6 +37,10 @@ .file-title { cursor: pointer; + a:hover { + text-decoration: none; + } + &:hover { background-color: $gray-normal; } diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index 75885badac9..4b65d3c44c4 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -1,6 +1,6 @@ - environment = local_assigns.fetch(:environment, nil) .diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_commit.id) } - .file-title + .file-title-flex-parent = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "##{file_hash}" - unless diff_file.submodule? diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml index ddec775b789..5b09b6907ab 100644 --- a/app/views/projects/diffs/_file_header.html.haml +++ b/app/views/projects/diffs/_file_header.html.haml @@ -10,13 +10,13 @@ - if diff_file.renamed_file - old_path, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path) - %strong + %strong.file-title-name.has-tooltip{ data: { title: old_path } } = old_path → - %strong + %strong.file-title-name.has-tooltip{ data: { title: new_path } } = new_path - else - %strong + %strong.file-title-name.has-tooltip{ data: { title: diff_file.new_path } } = diff_file.new_path - if diff_file.deleted_file deleted diff --git a/changelogs/unreleased/25709-diff-file-overflow.yml b/changelogs/unreleased/25709-diff-file-overflow.yml new file mode 100644 index 00000000000..7d1b2b36ab8 --- /dev/null +++ b/changelogs/unreleased/25709-diff-file-overflow.yml @@ -0,0 +1,4 @@ +--- +title: Responsive title in diffs inline, side by side, with and without sidebar +merge_request: 8475 +author: From b57027f2a5e3b5b5c786ed72ad8d2c8d16725b17 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Sun, 5 Feb 2017 22:28:48 +0000 Subject: [PATCH 2/5] Use a new class to keep old behavior --- app/assets/javascripts/diff.js.es6 | 2 +- app/assets/javascripts/single_file_diff.js | 4 +-- app/views/admin/logs/show.html.haml | 2 +- app/views/ci/lints/show.html.haml | 2 +- .../discussions/_diff_with_notes.html.haml | 2 +- app/views/help/ui.html.haml | 2 +- app/views/projects/blame/show.html.haml | 2 +- app/views/projects/blob/_blob.html.haml | 2 +- app/views/projects/blob/_editor.html.haml | 2 +- app/views/projects/diffs/_file.html.haml | 2 +- .../merge_requests/conflicts.html.haml | 2 +- app/views/projects/snippets/show.html.haml | 2 +- app/views/projects/tree/_readme.html.haml | 2 +- app/views/search/results/_blob.html.haml | 2 +- .../search/results/_snippet_blob.html.haml | 2 +- app/views/search/results/_wiki_blob.html.haml | 2 +- app/views/shared/snippets/_form.html.haml | 2 +- .../sherlock/file_samples/show.html.haml | 2 +- app/views/snippets/show.html.haml | 2 +- spec/features/expand_collapse_diffs_spec.rb | 28 +++++++++---------- .../projects/files/find_file_keyboard_spec.rb | 4 +-- 21 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/assets/javascripts/diff.js.es6 b/app/assets/javascripts/diff.js.es6 index c39e30fb7e0..ccccd0a36ff 100644 --- a/app/assets/javascripts/diff.js.es6 +++ b/app/assets/javascripts/diff.js.es6 @@ -76,7 +76,7 @@ require('./lib/utils/url_utility'); const diffFile = diffTitle.closest('.diff-file'); const nothingHereBlock = $('.nothing-here-block:visible', diffFile); if (nothingHereBlock.length) { - const clickTarget = $('.file-title, .click-to-expand', diffFile); + const clickTarget = $('.js-file-title, .click-to-expand', diffFile); diffFile.data('singleFileDiff').toggleDiff(clickTarget, () => { this.highlighSelectedLine(); if (cb) cb(); diff --git a/app/assets/javascripts/single_file_diff.js b/app/assets/javascripts/single_file_diff.js index 5b20c63384c..3ee0c73a8d2 100644 --- a/app/assets/javascripts/single_file_diff.js +++ b/app/assets/javascripts/single_file_diff.js @@ -33,13 +33,13 @@ this.$toggleIcon.addClass('fa-caret-down'); } - $('.file-title, .click-to-expand', this.file).on('click', (function (e) { + $('.js-file-title, .click-to-expand', this.file).on('click', (function (e) { this.toggleDiff($(e.target)); }).bind(this)); } SingleFileDiff.prototype.toggleDiff = function($target, cb) { - if (!$target.hasClass('file-title') && !$target.hasClass('click-to-expand') && !$target.hasClass('diff-toggle-caret')) return; + if (!$target.hasClass('js-file-title') && !$target.hasClass('click-to-expand') && !$target.hasClass('diff-toggle-caret')) return; this.isOpen = !this.isOpen; if (!this.isOpen && !this.hasError) { this.content.hide(); diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml index 0a954c20fcd..13d00dd1fcb 100644 --- a/app/views/admin/logs/show.html.haml +++ b/app/views/admin/logs/show.html.haml @@ -18,7 +18,7 @@ .tab-pane{ class: (klass == Gitlab::GitLogger ? 'active' : ''), id: klass::file_name_noext } .file-holder#README - .file-title + .js-file-title.file-title %i.fa.fa-file = klass::file_name .pull-right diff --git a/app/views/ci/lints/show.html.haml b/app/views/ci/lints/show.html.haml index b0bee1c6204..dfbc7772698 100644 --- a/app/views/ci/lints/show.html.haml +++ b/app/views/ci/lints/show.html.haml @@ -11,7 +11,7 @@ .form-group .col-sm-12 .file-holder - .file-title.clearfix + .js-file-title.file-title.clearfix Content of .gitlab-ci.yml #ci-editor.ci-editor= @content = text_area_tag(:content, @content, class: 'hidden form-control span1', rows: 7, require: true) diff --git a/app/views/discussions/_diff_with_notes.html.haml b/app/views/discussions/_diff_with_notes.html.haml index 3a95a652810..94408b92374 100644 --- a/app/views/discussions/_diff_with_notes.html.haml +++ b/app/views/discussions/_diff_with_notes.html.haml @@ -2,7 +2,7 @@ - blob = discussion.blob .diff-file.file-holder - .file-title + .js-file-title.file-title = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_file.content_commit, project: discussion.project, url: discussion_diff_path(discussion) .diff-content.code.js-syntax-highlight diff --git a/app/views/help/ui.html.haml b/app/views/help/ui.html.haml index dd1df46792b..87f9b503989 100644 --- a/app/views/help/ui.html.haml +++ b/app/views/help/ui.html.haml @@ -528,7 +528,7 @@ - blob = Snippet.new(content: "Wow\nSuch\nFile") .example .file-holder - .file-title + .js-file-title.file-title Awesome file .file-actions .btn-group diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index 23f54553014..8a40281e28c 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -7,7 +7,7 @@ #blob-content-holder.tree-holder .file-holder - .file-title + .js-file-title.file-title = blob_icon @blob.mode, @blob.name %strong = @path diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index f75f438ee4f..19fa4c78501 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -24,7 +24,7 @@ #blob-content-holder.blob-content-holder %article.file-holder - .file-title + .js-file-title.file-title = blob_icon blob.mode, blob.name %strong = blob.name diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index 228ac61fc8c..e7adef5558a 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -1,5 +1,5 @@ .file-holder.file.append-bottom-default - .file-title.clearfix + .js-file-title.file-title.clearfix .editor-ref = icon('code-fork') = ref diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index 4b65d3c44c4..cb5a83ae843 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -1,6 +1,6 @@ - environment = local_assigns.fetch(:environment, nil) .diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_commit.id) } - .file-title-flex-parent + .js-file-title.file-title-flex-parent = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "##{file_hash}" - unless diff_file.submodule? diff --git a/app/views/projects/merge_requests/conflicts.html.haml b/app/views/projects/merge_requests/conflicts.html.haml index dcf578b85f9..1ecd9924d88 100644 --- a/app/views/projects/merge_requests/conflicts.html.haml +++ b/app/views/projects/merge_requests/conflicts.html.haml @@ -23,7 +23,7 @@ .files-wrapper{ "v-if" => "!isLoading && !hasError" } .files .diff-file.file-holder.conflict{ "v-for" => "file in conflictsData.files" } - .file-title + .js-file-title.file-title %i.fa.fa-fw{ ":class" => "file.iconClass" } %strong {{file.filePath}} = render partial: 'projects/merge_requests/conflicts/file_actions' diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml index 485b23815bc..6b3d7d4008b 100644 --- a/app/views/projects/snippets/show.html.haml +++ b/app/views/projects/snippets/show.html.haml @@ -4,7 +4,7 @@ .project-snippets %article.file-holder.snippet-file-content - .file-title + .js-file-title.file-title = blob_icon 0, @snippet.file_name = @snippet.file_name .file-actions diff --git a/app/views/projects/tree/_readme.html.haml b/app/views/projects/tree/_readme.html.haml index a1f4e3e8ed6..bdcc160a067 100644 --- a/app/views/projects/tree/_readme.html.haml +++ b/app/views/projects/tree/_readme.html.haml @@ -1,5 +1,5 @@ %article.file-holder.readme-holder - .file-title + .js-file-title.file-title = blob_icon readme.mode, readme.name = link_to namespace_project_blob_path(@project.namespace, @project, tree_join(@ref, @path, readme.name)) do %strong diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml index 9e8adc82583..7f1f807e2e7 100644 --- a/app/views/search/results/_blob.html.haml +++ b/app/views/search/results/_blob.html.haml @@ -1,7 +1,7 @@ - file_name, blob = blob .blob-result .file-holder - .file-title + .js-file-title.file-title - ref = @search_results.repository_ref - blob_link = namespace_project_blob_path(@project.namespace, @project, tree_join(ref, file_name)) = link_to blob_link do diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml index 23ca6479414..f7808ea6aff 100644 --- a/app/views/search/results/_snippet_blob.html.haml +++ b/app/views/search/results/_snippet_blob.html.haml @@ -14,7 +14,7 @@ - snippet_path = reliable_snippet_path(snippet) = link_to snippet_path do .file-holder - .file-title + .js-file-title.file-title %i.fa.fa-file %strong= snippet.file_name - if markup?(snippet.file_name) diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml index 648d0bd76cb..d87f9df2677 100644 --- a/app/views/search/results/_wiki_blob.html.haml +++ b/app/views/search/results/_wiki_blob.html.haml @@ -1,7 +1,7 @@ - wiki_blob = parse_search_result(wiki_blob) .blob-result .file-holder - .file-title + .js-file-title.file-title = link_to namespace_project_wiki_path(@project.namespace, @project, wiki_blob.basename) do %i.fa.fa-file %strong diff --git a/app/views/shared/snippets/_form.html.haml b/app/views/shared/snippets/_form.html.haml index 56c0f7390a5..e7f7db73223 100644 --- a/app/views/shared/snippets/_form.html.haml +++ b/app/views/shared/snippets/_form.html.haml @@ -18,7 +18,7 @@ = f.label :file_name, "File", class: 'control-label' .col-sm-10 .file-holder.snippet - .file-title + .js-file-title.file-title = f.text_field :file_name, placeholder: "Optionally name this file to add code highlighting, e.g. example.rb for Ruby.", class: 'form-control snippet-file-name' .file-content.code %pre#editor= @snippet.content diff --git a/app/views/sherlock/file_samples/show.html.haml b/app/views/sherlock/file_samples/show.html.haml index 92151176fce..1a6e2542dc1 100644 --- a/app/views/sherlock/file_samples/show.html.haml +++ b/app/views/sherlock/file_samples/show.html.haml @@ -26,7 +26,7 @@ = @file_sample.events %article.file-holder - .file-title + .js-file-title.file-title %i.fa.fa-file-text-o.fa-fw %strong = @file_sample.file diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 837a1a0cc8c..970afbe6b64 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -3,7 +3,7 @@ = render 'shared/snippets/header' %article.file-holder.snippet-file-content - .file-title + .js-file-title.file-title = blob_icon 0, @snippet.file_name = @snippet.file_name .file-actions diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 8b3e2fa93a2..630467e647f 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -72,8 +72,8 @@ feature 'Expand and collapse diffs', js: true, feature: true do it 'collapses large diffs for renamed files by default' do expect(large_diff_renamed).not_to have_selector('.code') expect(large_diff_renamed).to have_selector('.nothing-here-block') - expect(large_diff_renamed).to have_selector('.file-title .deletion') - expect(large_diff_renamed).to have_selector('.file-title .addition') + expect(large_diff_renamed).to have_selector('.js-file-title .deletion') + expect(large_diff_renamed).to have_selector('.js-file-title .addition') end it 'shows non-renderable diffs as such immediately, regardless of their size' do @@ -115,9 +115,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'expanding a large diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `large_diff.md` title - all('.file-title')[1].click + all('.js-file-title')[1].click wait_for_ajax end @@ -159,9 +159,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'expanding the diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `large_diff.md` title - all('.file-title')[1].click + all('.js-file-title')[1].click wait_for_ajax end @@ -181,9 +181,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'collapsing an expanded diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.file-title')[3].click + all('.js-file-title')[3].click end it 'hides the diff content' do @@ -194,9 +194,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 're-expanding the same diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.file-title')[3].click + all('.js-file-title')[3].click end it 'shows the diff content' do @@ -290,9 +290,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'collapsing an expanded diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.file-title')[3].click + all('.js-file-title')[3].click end it 'hides the diff content' do @@ -303,9 +303,9 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 're-expanding the same diff' do before do # Wait for diffs - find('.file-title', match: :first) + find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.file-title')[3].click + all('.js-file-title')[3].click end it 'shows the diff content' do diff --git a/spec/features/projects/files/find_file_keyboard_spec.rb b/spec/features/projects/files/find_file_keyboard_spec.rb index fc88fd74af8..582349d8d5b 100644 --- a/spec/features/projects/files/find_file_keyboard_spec.rb +++ b/spec/features/projects/files/find_file_keyboard_spec.rb @@ -22,7 +22,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do expect(page).to have_selector('.blob-content-holder') - page.within('.file-title') do + page.within('.js-file-title') do expect(page).to have_content('CHANGELOG') end end @@ -35,7 +35,7 @@ feature 'Find file keyboard shortcuts', feature: true, js: true do expect(page).to have_selector('.blob-content-holder') - page.within('.file-title') do + page.within('.js-file-title') do expect(page).to have_content('application.js') end end From 2352a392e5fc5a0a8e7461a9920f5b3c89d819c8 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Wed, 8 Feb 2017 17:06:04 -0600 Subject: [PATCH 3/5] Align file header items while keeping collapse functionality --- app/assets/stylesheets/framework/files.scss | 14 ++++++++++++-- app/assets/stylesheets/pages/diff.scss | 3 ++- app/views/projects/diffs/_file.html.haml | 3 ++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index db1c8da06d0..c2dfa55b511 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -236,17 +236,27 @@ span.idiff { .file-title-flex-parent { display: flex; align-items: center; + justify-content:space-between; background-color: $gray-light; border-bottom: 1px solid $border-color; padding: 10px $gl-padding; margin: 0; border-radius: 3px 3px 0 0; - > a { - flex: 1; + .file-header-content { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + padding-right: 30px; + position: relative; + } + + .btn-clipboard { + position: absolute; + right: 0; + } + + a { color: $gl-text-color; } diff --git a/app/assets/stylesheets/pages/diff.scss b/app/assets/stylesheets/pages/diff.scss index 8b784c2a439..92d7772da57 100644 --- a/app/assets/stylesheets/pages/diff.scss +++ b/app/assets/stylesheets/pages/diff.scss @@ -34,7 +34,8 @@ } } - .file-title { + .file-title, + .file-title-flex-parent { cursor: pointer; a:hover { diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index cb5a83ae843..0232a09b4a8 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -1,7 +1,8 @@ - environment = local_assigns.fetch(:environment, nil) .diff-file.file-holder{ id: file_hash, data: diff_file_html_data(project, diff_file.file_path, diff_commit.id) } .js-file-title.file-title-flex-parent - = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "##{file_hash}" + .file-header-content + = render "projects/diffs/file_header", diff_file: diff_file, blob: blob, diff_commit: diff_commit, project: project, url: "##{file_hash}" - unless diff_file.submodule? .file-actions.hidden-xs From 6cb7dc7a8d09aab6635ff5fc3977aeb789035c39 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Wed, 8 Feb 2017 18:00:17 -0600 Subject: [PATCH 4/5] Reduce file header padding --- app/assets/stylesheets/framework/files.scss | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/framework/files.scss b/app/assets/stylesheets/framework/files.scss index c2dfa55b511..30f242a35db 100644 --- a/app/assets/stylesheets/framework/files.scss +++ b/app/assets/stylesheets/framework/files.scss @@ -232,14 +232,13 @@ span.idiff { } } - .file-title-flex-parent { display: flex; align-items: center; - justify-content:space-between; + justify-content: space-between; background-color: $gray-light; border-bottom: 1px solid $border-color; - padding: 10px $gl-padding; + padding: 5px $gl-padding; margin: 0; border-radius: 3px 3px 0 0; From 83e2bfbae04385e09dae924629ac6a9e22b3ad4c Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Thu, 9 Feb 2017 09:00:54 -0600 Subject: [PATCH 5/5] Fix expand_collapse_diffs specs --- spec/features/expand_collapse_diffs_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 630467e647f..8c64b050e19 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -117,7 +117,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `large_diff.md` title - all('.js-file-title')[1].click + all('.diff-toggle-caret')[1].click wait_for_ajax end @@ -161,7 +161,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `large_diff.md` title - all('.js-file-title')[1].click + all('.diff-toggle-caret')[1].click wait_for_ajax end @@ -183,7 +183,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.js-file-title')[3].click + all('.diff-toggle-caret')[3].click end it 'hides the diff content' do @@ -196,7 +196,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.js-file-title')[3].click + all('.diff-toggle-caret')[3].click end it 'shows the diff content' do @@ -292,7 +292,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.js-file-title')[3].click + all('.diff-toggle-caret')[3].click end it 'hides the diff content' do @@ -305,7 +305,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do # Wait for diffs find('.js-file-title', match: :first) # Click `small_diff.md` title - all('.js-file-title')[3].click + all('.diff-toggle-caret')[3].click end it 'shows the diff content' do