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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
75847b55
Commit
75847b55
authored
Oct 30, 2018
by
Ramya Authappan
Committed by
Grzegorz Bizon
Oct 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding tests for filtering activities/comments in issues
parent
d0b746d8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
15 deletions
+55
-15
app/assets/javascripts/notes/components/discussion_filter.vue
...assets/javascripts/notes/components/discussion_filter.vue
+3
-4
qa/qa/page/project/issue/show.rb
qa/qa/page/project/issue/show.rb
+18
-11
qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb
...res/browser_ui/2_plan/issue/filter_issue_comments_spec.rb
+34
-0
No files found.
app/assets/javascripts/notes/components/discussion_filter.vue
View file @
75847b55
...
@@ -22,9 +22,7 @@ export default {
...
@@ -22,9 +22,7 @@ export default {
return
{
currentValue
:
this
.
defaultValue
};
return
{
currentValue
:
this
.
defaultValue
};
},
},
computed
:
{
computed
:
{
...
mapGetters
([
...
mapGetters
([
'
getNotesDataByProp
'
]),
'
getNotesDataByProp
'
,
]),
currentFilter
()
{
currentFilter
()
{
if
(
!
this
.
currentValue
)
return
this
.
filters
[
0
];
if
(
!
this
.
currentValue
)
return
this
.
filters
[
0
];
return
this
.
filters
.
find
(
filter
=>
filter
.
value
===
this
.
currentValue
);
return
this
.
filters
.
find
(
filter
=>
filter
.
value
===
this
.
currentValue
);
...
@@ -51,7 +49,7 @@ export default {
...
@@ -51,7 +49,7 @@ export default {
<button
<button
id=
"discussion-filter-dropdown"
id=
"discussion-filter-dropdown"
ref=
"dropdownToggle"
ref=
"dropdownToggle"
class=
"btn btn-default"
class=
"btn btn-default
qa-discussion-filter
"
data-toggle=
"dropdown"
data-toggle=
"dropdown"
aria-expanded=
"false"
aria-expanded=
"false"
>
>
...
@@ -69,6 +67,7 @@ export default {
...
@@ -69,6 +67,7 @@ export default {
>
>
<button
<button
:class=
"
{ 'is-active': filter.value === currentValue }"
:class=
"
{ 'is-active': filter.value === currentValue }"
class="qa-filter-options"
type="button"
type="button"
@click="selectFilter(filter.value)"
@click="selectFilter(filter.value)"
>
>
...
...
qa/qa/page/project/issue/show.rb
View file @
75847b55
...
@@ -7,35 +7,42 @@ module QA
...
@@ -7,35 +7,42 @@ module QA
class
Show
<
Page
::
Base
class
Show
<
Page
::
Base
include
Page
::
Component
::
Issuable
::
Common
include
Page
::
Component
::
Issuable
::
Common
view
'app/views/projects/issues/show.html.haml'
do
element
:issue_details
,
'.issue-details'
# rubocop:disable QA/ElementWithPattern
element
:title
,
'.title'
# rubocop:disable QA/ElementWithPattern
end
view
'app/views/shared/notes/_form.html.haml'
do
view
'app/views/shared/notes/_form.html.haml'
do
element
:new_note_form
,
'new-note'
# rubocop:disable QA/ElementWithPattern
element
:new_note_form
,
'new-note'
# rubocop:disable QA/ElementWithPattern
element
:new_note_form
,
'attr: :note'
# rubocop:disable QA/ElementWithPattern
element
:new_note_form
,
'attr: :note'
# rubocop:disable QA/ElementWithPattern
end
end
view
'app/views/shared/notes/_comment_button.html.haml'
do
view
'app/assets/javascripts/notes/components/comment_form.vue'
do
element
:comment_button
,
'%strong Comment'
# rubocop:disable QA/ElementWithPattern
element
:comment_button
element
:comment_input
end
end
def
issue_title
view
'app/assets/javascripts/notes/components/discussion_filter.vue'
do
find
(
'.issue-details .title'
).
text
element
:discussion_filter
element
:filter_options
end
end
# Adds a comment to an issue
# Adds a comment to an issue
# attachment option should be an absolute path
# attachment option should be an absolute path
def
comment
(
text
,
attachment:
nil
)
def
comment
(
text
,
attachment:
nil
)
fill_
in
(
with:
text
,
name:
'note[note]'
)
fill_
element
:comment_input
,
text
unless
attachment
.
nil?
unless
attachment
.
nil?
QA
::
Page
::
Component
::
Dropzone
.
new
(
self
,
'.new-note'
)
QA
::
Page
::
Component
::
Dropzone
.
new
(
self
,
'.new-note'
)
.
attach_file
(
attachment
)
.
attach_file
(
attachment
)
end
end
click_on
'Comment'
click_element
:comment_button
end
def
select_comments_only_filter
click_element
:discussion_filter
all_elements
(
:filter_options
).
last
.
click
end
def
select_all_activities_filter
click_element
:discussion_filter
all_elements
(
:filter_options
).
first
.
click
end
end
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/2_plan/issue/filter_issue_comments_spec.rb
0 → 100644
View file @
75847b55
# frozen_string_literal: true
module
QA
context
'Plan'
do
describe
'filter issue comments activities'
do
let
(
:issue_title
)
{
'issue title'
}
it
'user filters comments and activites in an issue'
do
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
Factory
::
Resource
::
Issue
.
fabricate!
do
|
issue
|
issue
.
title
=
issue_title
end
expect
(
page
).
to
have_content
(
issue_title
)
Page
::
Project
::
Issue
::
Show
.
perform
do
|
show_page
|
show_page
.
select_comments_only_filter
show_page
.
comment
(
'/confidential'
)
show_page
.
comment
(
'My own comment'
)
expect
(
show_page
).
not_to
have_content
(
"made the issue confidential"
)
expect
(
show_page
).
to
have_content
(
"My own comment"
)
show_page
.
select_all_activities_filter
expect
(
show_page
).
to
have_content
(
"made the issue confidential"
)
expect
(
show_page
).
to
have_content
(
"My own comment"
)
end
end
end
end
end
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