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
e3395e3a
Commit
e3395e3a
authored
Nov 14, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for clear search button
parent
c07a5227
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
0 deletions
+55
-0
spec/features/issues/search_bar_spec.rb
spec/features/issues/search_bar_spec.rb
+55
-0
No files found.
spec/features/issues/search_bar_spec.rb
0 → 100644
View file @
e3395e3a
require
'rails_helper'
describe
'Search bar'
,
feature:
true
do
include
WaitForAjax
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:group
)
{
create
(
:group
)
}
let!
(
:user
)
{
create
(
:user
)
}
before
do
project
.
team
<<
[
user
,
:master
]
group
.
add_developer
(
user
)
login_as
(
user
)
create
(
:issue
,
project:
project
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
)
end
describe
'clear search button'
,
js:
true
do
it
'clears text'
do
search_text
=
'search_text'
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
search_text
)
expect
(
filtered_search
.
value
).
to
eq
(
search_text
)
find
(
'.filtered-search-input-container .clear-search'
).
click
expect
(
filtered_search
.
value
).
to
eq
(
''
)
end
it
'hides by default'
do
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
end
it
'hides after clicked'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
find
(
'.filtered-search-input-container .clear-search'
).
click
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
end
it
'hides when there is no text'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
''
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
end
it
'shows when there is text'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
true
)
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