Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9afc3069
Commit
9afc3069
authored
Dec 04, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed diff files not expanding
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/54868
parent
40343096
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+1
-1
spec/features/merge_request/user_expands_diff_spec.rb
spec/features/merge_request/user_expands_diff_spec.rb
+23
-0
spec/javascripts/diffs/store/actions_spec.js
spec/javascripts/diffs/store/actions_spec.js
+1
-1
No files found.
app/assets/javascripts/diffs/store/actions.js
View file @
9afc3069
...
@@ -148,7 +148,7 @@ export const scrollToLineIfNeededParallel = (_, line) => {
...
@@ -148,7 +148,7 @@ export const scrollToLineIfNeededParallel = (_, line) => {
};
};
export
const
loadCollapsedDiff
=
({
commit
},
file
)
=>
export
const
loadCollapsedDiff
=
({
commit
},
file
)
=>
axios
.
get
(
file
.
load
CollapsedDiffU
rl
).
then
(
res
=>
{
axios
.
get
(
file
.
load
_collapsed_diff_u
rl
).
then
(
res
=>
{
commit
(
types
.
ADD_COLLAPSED_DIFFS
,
{
commit
(
types
.
ADD_COLLAPSED_DIFFS
,
{
file
,
file
,
data
:
res
.
data
,
data
:
res
.
data
,
...
...
spec/features/merge_request/user_expands_diff_spec.rb
0 → 100644
View file @
9afc3069
require
'spec_helper'
describe
'User expands diff'
,
:js
do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
before
do
visit
(
diffs_project_merge_request_path
(
project
,
merge_request
))
wait_for_requests
end
it
'allows user to expand diff'
do
page
.
within
find
(
'[id="19763941ab80e8c09871c0a425f0560d9053bcb3"]'
)
do
click_link
'Click to expand it.'
wait_for_requests
expect
(
page
).
not_to
have_content
(
'Click to expand it.'
)
expect
(
page
).
to
have_selector
(
'.code'
)
end
end
end
spec/javascripts/diffs/store/actions_spec.js
View file @
9afc3069
...
@@ -379,7 +379,7 @@ describe('DiffsStoreActions', () => {
...
@@ -379,7 +379,7 @@ describe('DiffsStoreActions', () => {
describe
(
'
loadCollapsedDiff
'
,
()
=>
{
describe
(
'
loadCollapsedDiff
'
,
()
=>
{
it
(
'
should fetch data and call mutation with response and the give parameter
'
,
done
=>
{
it
(
'
should fetch data and call mutation with response and the give parameter
'
,
done
=>
{
const
file
=
{
hash
:
123
,
load
CollapsedDiffU
rl
:
'
/load/collapsed/diff/url
'
};
const
file
=
{
hash
:
123
,
load
_collapsed_diff_u
rl
:
'
/load/collapsed/diff/url
'
};
const
data
=
{
hash
:
123
,
parallelDiffLines
:
[{
lineCode
:
1
}]
};
const
data
=
{
hash
:
123
,
parallelDiffLines
:
[{
lineCode
:
1
}]
};
const
mock
=
new
MockAdapter
(
axios
);
const
mock
=
new
MockAdapter
(
axios
);
mock
.
onGet
(
file
.
loadCollapsedDiffUrl
).
reply
(
200
,
data
);
mock
.
onGet
(
file
.
loadCollapsedDiffUrl
).
reply
(
200
,
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment