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
fad92a2e
Commit
fad92a2e
authored
Jul 05, 2019
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix divergence graph loading error
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/64143
parent
f845a081
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app/assets/javascripts/branches/divergence_graph.js
app/assets/javascripts/branches/divergence_graph.js
+3
-1
spec/frontend/branches/divergence_graph_spec.js
spec/frontend/branches/divergence_graph_spec.js
+10
-2
No files found.
app/assets/javascripts/branches/divergence_graph.js
View file @
fad92a2e
...
...
@@ -36,7 +36,9 @@ export default endpoint => {
},
100
);
Object
.
entries
(
data
).
forEach
(([
branchName
,
val
])
=>
{
const
el
=
document
.
querySelector
(
`.js-branch-
${
branchName
}
.js-branch-divergence-graph`
);
const
el
=
document
.
querySelector
(
`[data-name="
${
branchName
}
"] .js-branch-divergence-graph`
,
);
if
(
!
el
)
return
;
...
...
spec/frontend/branches/divergence_graph_spec.js
View file @
fad92a2e
...
...
@@ -10,12 +10,14 @@ describe('Divergence graph', () => {
mock
.
onGet
(
'
/-/diverging_counts
'
).
reply
(
200
,
{
master
:
{
ahead
:
1
,
behind
:
1
},
'
test/hello-world
'
:
{
ahead
:
1
,
behind
:
1
},
});
jest
.
spyOn
(
axios
,
'
get
'
);
document
.
body
.
innerHTML
=
`
<div class="js-branch-item" data-name="master"></div>
<div class="js-branch-item" data-name="master"><div class="js-branch-divergence-graph"></div></div>
<div class="js-branch-item" data-name="test/hello-world"><div class="js-branch-divergence-graph"></div></div>
`
;
});
...
...
@@ -26,7 +28,13 @@ describe('Divergence graph', () => {
it
(
'
calls axos get with list of branch names
'
,
()
=>
init
(
'
/-/diverging_counts
'
).
then
(()
=>
{
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
'
/-/diverging_counts
'
,
{
params
:
{
names
:
[
'
master
'
]
},
params
:
{
names
:
[
'
master
'
,
'
test/hello-world
'
]
},
});
}));
it
(
'
creates Vue components
'
,
()
=>
init
(
'
/-/diverging_counts
'
).
then
(()
=>
{
expect
(
document
.
querySelector
(
'
[data-name="master"]
'
).
innerHTML
).
not
.
toEqual
(
''
);
expect
(
document
.
querySelector
(
'
[data-name="test/hello-world"]
'
).
innerHTML
).
not
.
toEqual
(
''
);
}));
});
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