diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-10-01 10:59:32 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-10-01 10:59:32 +0000 |
commit | 964d1bb143ae76ee5660a01a2bf9eaa5236cd090 (patch) | |
tree | f8d154cb088b333ae4a2032da248f34183b33eec /spec/features/expand_collapse_diffs_spec.rb | |
parent | fc6ae3fb583390b9955d1fc569168535925093cb (diff) | |
parent | 40c7ba0129b0954802d4045c4b95626166cdfdc4 (diff) | |
download | gitlab-ce-964d1bb143ae76ee5660a01a2bf9eaa5236cd090.tar.gz |
Merge branch '21369-make-it-clearer-that-diffs-can-be-collapsed' into 'master'
Updated diff toggle targets and added icon
## What does this MR do?
Adds the new diff toggle icon and alters the toggle targets.
User can now click on the file header bar _(where no other elements are above it, apart from the icon)_ and the `Click to expand` link to expand the diff and no where else.
## Are there points in the code the reviewer needs to double check?
## Why was this MR needed?
## Screenshots (if relevant)
![Screen_Shot_2016-09-02_at_15.35.15](/uploads/c1cb8c0547328153250294d6c95dd96a/Screen_Shot_2016-09-02_at_15.35.15.png)
#### Gif
![2016-09-02_15.34.31](/uploads/abaefaeba9ce8ef129522dae34574c57/2016-09-02_15.34.31.gif)
## Does this MR meet the acceptance criteria?
- [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #21369
Closes #20326
See merge request !6183
Diffstat (limited to 'spec/features/expand_collapse_diffs_spec.rb')
-rw-r--r-- | spec/features/expand_collapse_diffs_spec.rb | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb index 8863554ee91..6c938bdead8 100644 --- a/spec/features/expand_collapse_diffs_spec.rb +++ b/spec/features/expand_collapse_diffs_spec.rb @@ -68,7 +68,7 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'expanding a diff for a renamed file' do before do - large_diff_renamed.find('.nothing-here-block').click + large_diff_renamed.find('.click-to-expand').click wait_for_ajax end @@ -87,7 +87,10 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'expanding a large diff' do before do - click_link('large_diff.md') + # Wait for diffs + find('.file-title', match: :first) + # Click `large_diff.md` title + all('.file-title')[1].click wait_for_ajax end @@ -128,7 +131,10 @@ feature 'Expand and collapse diffs', js: true, feature: true do context 'expanding the diff' do before do - click_link('large_diff.md') + # Wait for diffs + find('.file-title', match: :first) + # Click `large_diff.md` title + all('.file-title')[1].click wait_for_ajax end @@ -146,7 +152,12 @@ feature 'Expand and collapse diffs', js: true, feature: true do end context 'collapsing an expanded diff' do - before { click_link('small_diff.md') } + before do + # Wait for diffs + find('.file-title', match: :first) + # Click `small_diff.md` title + all('.file-title')[3].click + end it 'hides the diff content' do expect(small_diff).not_to have_selector('.code') @@ -154,7 +165,12 @@ feature 'Expand and collapse diffs', js: true, feature: true do end context 're-expanding the same diff' do - before { click_link('small_diff.md') } + before do + # Wait for diffs + find('.file-title', match: :first) + # Click `small_diff.md` title + all('.file-title')[3].click + end it 'shows the diff content' do expect(small_diff).to have_selector('.code') @@ -231,7 +247,12 @@ feature 'Expand and collapse diffs', js: true, feature: true do end context 'collapsing an expanded diff' do - before { click_link('small_diff.md') } + before do + # Wait for diffs + find('.file-title', match: :first) + # Click `small_diff.md` title + all('.file-title')[3].click + end it 'hides the diff content' do expect(small_diff).not_to have_selector('.code') @@ -239,7 +260,12 @@ feature 'Expand and collapse diffs', js: true, feature: true do end context 're-expanding the same diff' do - before { click_link('small_diff.md') } + before do + # Wait for diffs + find('.file-title', match: :first) + # Click `small_diff.md` title + all('.file-title')[3].click + end it 'shows the diff content' do expect(small_diff).to have_selector('.code') |