Commit 12430b65 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-compare-diff-unfold' into 'master'

Fix code unfold not working on Compare commits page

### What does this MR do?

The code unfold buttons (`...`) don't work when you go to Commits -> Compare mode. This MR fixes that.

### Are there points in the code the reviewer needs to double check?

Check to make sure all the right initializers are run in the `projects:compare:xxx` case. I'm also not sure if there are other cases where a diff is shown but the code unfolding is not activated.

### What are the relevant issue numbers / [Feature requests](http://feedback.gitlab.com/)?

Closes #1274

See merge request !434
parents d41b2085 eecd8971
...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date. ...@@ -2,6 +2,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 7.10.0 (unreleased) v 7.10.0 (unreleased)
- Allow HTML tags in Markdown input - Allow HTML tags in Markdown input
- Fix code unfold not working on Compare commits page (Stan Hu)
- Include missing events and fix save functionality in admin service template settings form (Stan Hu) - Include missing events and fix save functionality in admin service template settings form (Stan Hu)
- Fix "Import projects from" button to show the correct instructions (Stan Hu) - Fix "Import projects from" button to show the correct instructions (Stan Hu)
- Fix dots in Wiki slugs causing errors (Stan Hu) - Fix dots in Wiki slugs causing errors (Stan Hu)
......
...@@ -28,6 +28,8 @@ class Dispatcher ...@@ -28,6 +28,8 @@ class Dispatcher
new Milestone() new Milestone()
when 'projects:milestones:new', 'projects:milestones:edit' when 'projects:milestones:new', 'projects:milestones:edit'
new ZenMode() new ZenMode()
when 'projects:compare:show'
new Diff()
when 'projects:issues:new','projects:issues:edit' when 'projects:issues:new','projects:issues:edit'
GitLab.GfmAutoComplete.setup() GitLab.GfmAutoComplete.setup()
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
...@@ -115,6 +117,8 @@ class Dispatcher ...@@ -115,6 +117,8 @@ class Dispatcher
new Project() new Project()
new ProjectAvatar() new ProjectAvatar()
switch path[1] switch path[1]
when 'compare'
shortcut_handler = new ShortcutsNavigation()
when 'edit' when 'edit'
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
new ProjectNew() new ProjectNew()
......
...@@ -21,10 +21,13 @@ Feature: Project Commits ...@@ -21,10 +21,13 @@ Feature: Project Commits
And I click side-by-side diff button And I click side-by-side diff button
Then I see inline diff button Then I see inline diff button
@javascript
Scenario: I compare refs Scenario: I compare refs
Given I visit compare refs page Given I visit compare refs page
And I fill compare fields with refs And I fill compare fields with refs
Then I see compared refs Then I see compared refs
And I unfold diff
Then I should see additional file lines
Scenario: I browse commits for a specific path Scenario: I browse commits for a specific path
Given I visit my project's commits page for a specific path Given I visit my project's commits page for a specific path
......
...@@ -38,6 +38,18 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps ...@@ -38,6 +38,18 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
click_button "Compare" click_button "Compare"
end end
step 'I unfold diff' do
@diff = first('.js-unfold')
@diff.click
sleep 2
end
step 'I should see additional file lines' do
within @diff.parent do
first('.new_line').text.should_not have_content "..."
end
end
step 'I see compared refs' do step 'I see compared refs' do
page.should have_content "Compare View" page.should have_content "Compare View"
page.should have_content "Commits (1)" page.should have_content "Commits (1)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment