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
a60c1fc4
Commit
a60c1fc4
authored
Aug 23, 2016
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unfold test to parallel and added 'diff discussion' context
parent
2473dade
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
app/assets/javascripts/files_comment_button.js
app/assets/javascripts/files_comment_button.js
+1
-1
spec/features/merge_requests/diff_notes_spec.rb
spec/features/merge_requests/diff_notes_spec.rb
+33
-2
No files found.
app/assets/javascripts/files_comment_button.js
View file @
a60c1fc4
...
...
@@ -125,7 +125,7 @@
};
FilesCommentButton
.
prototype
.
validateLineContent
=
function
(
lineContentElement
)
{
return
lineContentElement
.
attr
(
'
data-
note-type
'
)
&&
lineContentElement
.
attr
(
'
data-note-type
'
)
!==
''
;
return
lineContentElement
.
attr
(
'
data-
discussion-id
'
)
&&
lineContentElement
.
attr
(
'
data-discussion-id
'
)
!==
''
;
};
return
FilesCommentButton
;
...
...
spec/features/merge_requests/diff_notes_spec.rb
View file @
a60c1fc4
...
...
@@ -15,7 +15,7 @@ feature 'Diff notes', js: true, feature: true do
let
(
:notes_holder_input_xpath
)
{
'./following-sibling::*[contains(concat(" ", @class, " "), " notes_holder ")]'
}
let
(
:test_note_comment
)
{
'this is a test note!'
}
context
'when hovering over
the
parallel view diff file'
do
context
'when hovering over
a
parallel view diff file'
do
before
(
:each
)
do
visit
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
view:
'parallel'
)
end
...
...
@@ -69,9 +69,28 @@ feature 'Diff notes', js: true, feature: true do
should_not_allow_commenting
(
find
(
'.match'
,
match: :first
).
find
(
:xpath
,
'..'
),
'right'
)
end
end
context
'with an unfolded line'
do
before
(
:each
)
do
find
(
'.js-unfold'
,
match: :first
).
click
wait_for_ajax
end
# The first `.js-unfold` unfolds upwards, therefore the first
# `.line_holder` will be an unfolded line.
let
(
:line_holder
)
{
first
(
'.line_holder[id="1"]'
)
}
it
'should not allow commenting on the left side'
do
should_not_allow_commenting
(
line_holder
,
'left'
)
end
it
'should not allow commenting on the right side'
do
should_not_allow_commenting
(
line_holder
,
'right'
)
end
end
end
context
'when hovering over
the
inline view diff file'
do
context
'when hovering over
an
inline view diff file'
do
before
do
visit
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
view:
'inline'
)
end
...
...
@@ -114,6 +133,18 @@ feature 'Diff notes', js: true, feature: true do
should_not_allow_commenting
line_holder
end
end
context
'when hovering over a diff discussion'
do
before
do
visit
diffs_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
,
view:
'inline'
)
should_allow_commenting
(
find
(
'[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd_7_7"]'
))
visit
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
end
it
'should not allow commenting'
do
should_not_allow_commenting
(
find
(
'.line_holder'
,
match: :first
))
end
end
end
def
should_allow_commenting
(
line_holder
,
diff_side
=
nil
)
...
...
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