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
44ac8a50
Commit
44ac8a50
authored
Sep 16, 2020
by
jboyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comment button not rendering
parent
2ca11a5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
.../javascripts/diffs/components/parallel_diff_table_row.vue
+4
-4
spec/frontend/diffs/components/parallel_diff_table_row_spec.js
...frontend/diffs/components/parallel_diff_table_row_spec.js
+9
-8
No files found.
app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
View file @
44ac8a50
...
@@ -199,10 +199,10 @@ export default {
...
@@ -199,10 +199,10 @@ export default {
);
);
},
},
hasDiscussionsLeft
()
{
hasDiscussionsLeft
()
{
return
this
.
line
.
left
.
discussions
&&
this
.
line
.
left
.
discussions
.
length
>
0
;
return
this
.
line
.
left
?.
discussions
?
.
length
>
0
;
},
},
hasDiscussionsRight
()
{
hasDiscussionsRight
()
{
return
this
.
line
.
right
.
discussions
&&
this
.
line
.
right
.
discussions
.
length
>
0
;
return
this
.
line
.
right
?.
discussions
?
.
length
>
0
;
},
},
lineHrefOld
()
{
lineHrefOld
()
{
return
`#
${
this
.
line
.
left
.
line_code
||
''
}
`
;
return
`#
${
this
.
line
.
left
.
line_code
||
''
}
`
;
...
@@ -217,14 +217,14 @@ export default {
...
@@ -217,14 +217,14 @@ export default {
);
);
},
},
isMetaLineLeft
()
{
isMetaLineLeft
()
{
const
{
type
}
=
this
.
line
.
left
;
const
type
=
this
.
line
.
left
?.
type
;
return
(
return
(
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
);
);
},
},
isMetaLineRight
()
{
isMetaLineRight
()
{
const
{
type
}
=
this
.
line
.
right
;
const
type
=
this
.
line
.
right
?.
type
;
return
(
return
(
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
type
===
OLD_NO_NEW_LINE_TYPE
||
type
===
NEW_NO_NEW_LINE_TYPE
||
type
===
EMPTY_CELL_TYPE
...
...
spec/frontend/diffs/components/parallel_diff_table_row_spec.js
View file @
44ac8a50
...
@@ -228,19 +228,20 @@ describe('ParallelDiffTableRow', () => {
...
@@ -228,19 +228,20 @@ describe('ParallelDiffTableRow', () => {
const
findNoteButton
=
()
=>
wrapper
.
find
({
ref
:
'
addDiffNoteButtonLeft
'
});
const
findNoteButton
=
()
=>
wrapper
.
find
({
ref
:
'
addDiffNoteButtonLeft
'
});
it
.
each
`
it
.
each
`
hover | userData | query | mergeRefHeadComments | expectation
hover | line | userData | query | mergeRefHeadComments | expectation
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
true
}
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
true
}
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
true
}
|
${
true
}
${
true
}
|
${{
line
:
{
left
:
null
}
}} |
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
true
}
|
${
true
}
${
true
}
|
${
null
}
|
${
''
}
|
${
true
}
|
${
false
}
${
true
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=true
'
}
|
${
false
}
|
${
false
}
${
false
}
|
${
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
${
true
}
|
${{}}
|
$
{
null
}
|
${
''
}
|
${
true
}
|
${
false
}
${
false
}
|
${{}}
|
$
{
TEST_USER
}
|
${
'
diff_head=false
'
}
|
${
false
}
|
${
false
}
`
(
`
(
'
exists is $expectation - with userData ($userData) query ($query)
'
,
'
exists is $expectation - with userData ($userData) query ($query)
'
,
async
({
hover
,
userData
,
query
,
mergeRefHeadComments
,
expectation
})
=>
{
async
({
hover
,
line
,
userData
,
query
,
mergeRefHeadComments
,
expectation
})
=>
{
store
.
state
.
notes
.
userData
=
userData
;
store
.
state
.
notes
.
userData
=
userData
;
gon
.
features
=
{
mergeRefHeadComments
};
gon
.
features
=
{
mergeRefHeadComments
};
setWindowLocation
({
href
:
`
${
TEST_HOST
}
?
${
query
}
`
});
setWindowLocation
({
href
:
`
${
TEST_HOST
}
?
${
query
}
`
});
createComponent
(
{}
,
store
);
createComponent
(
line
,
store
);
if
(
hover
)
await
wrapper
.
find
(
'
.line_holder
'
).
trigger
(
'
mouseover
'
);
if
(
hover
)
await
wrapper
.
find
(
'
.line_holder
'
).
trigger
(
'
mouseover
'
);
expect
(
findNoteButton
().
exists
()).
toBe
(
expectation
);
expect
(
findNoteButton
().
exists
()).
toBe
(
expectation
);
...
...
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