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
fd90a996
Commit
fd90a996
authored
Dec 16, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define filtered_search as a variable
parent
625ecdbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
spec/features/issues/filtered_search/dropdown_hint_spec.rb
spec/features/issues/filtered_search/dropdown_hint_spec.rb
+1
-0
spec/features/issues/filtered_search/search_bar_spec.rb
spec/features/issues/filtered_search/search_bar_spec.rb
+1
-6
No files found.
spec/features/issues/filtered_search/dropdown_hint_spec.rb
View file @
fd90a996
...
@@ -6,6 +6,7 @@ describe 'Dropdown hint', js: true, feature: true do
...
@@ -6,6 +6,7 @@ describe 'Dropdown hint', js: true, feature: true do
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
login_as
(
user
)
...
...
spec/features/issues/filtered_search/search_bar_spec.rb
View file @
fd90a996
...
@@ -5,6 +5,7 @@ describe 'Search bar', js: true, feature: true do
...
@@ -5,6 +5,7 @@ describe 'Search bar', js: true, feature: true do
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:user
)
{
create
(
:user
)
}
let!
(
:user
)
{
create
(
:user
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
@@ -22,7 +23,6 @@ describe 'Search bar', js: true, feature: true do
...
@@ -22,7 +23,6 @@ describe 'Search bar', js: true, feature: true do
describe
'clear search button'
do
describe
'clear search button'
do
it
'clears text'
do
it
'clears text'
do
search_text
=
'search_text'
search_text
=
'search_text'
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
search_text
)
filtered_search
.
set
(
search_text
)
expect
(
filtered_search
.
value
).
to
eq
(
search_text
)
expect
(
filtered_search
.
value
).
to
eq
(
search_text
)
...
@@ -35,28 +35,24 @@ describe 'Search bar', js: true, feature: true do
...
@@ -35,28 +35,24 @@ describe 'Search bar', js: true, feature: true do
end
end
it
'hides after clicked'
do
it
'hides after clicked'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
'a'
)
find
(
'.filtered-search-input-container .clear-search'
).
click
find
(
'.filtered-search-input-container .clear-search'
).
click
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
end
end
it
'hides when there is no text'
do
it
'hides when there is no text'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
''
)
filtered_search
.
set
(
''
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
false
)
end
end
it
'shows when there is text'
do
it
'shows when there is text'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
'a'
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.clear-search'
,
visible:
true
)
end
end
it
'resets the dropdown hint filter'
do
it
'resets the dropdown hint filter'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
click
();
filtered_search
.
click
();
original_size
=
page
.
all
(
'#js-dropdown-hint .filter-dropdown .filter-dropdown-item'
).
size
original_size
=
page
.
all
(
'#js-dropdown-hint .filter-dropdown .filter-dropdown-item'
).
size
...
@@ -69,7 +65,6 @@ describe 'Search bar', js: true, feature: true do
...
@@ -69,7 +65,6 @@ describe 'Search bar', js: true, feature: true do
end
end
it
'resets the dropdown filters'
do
it
'resets the dropdown filters'
do
filtered_search
=
find
(
'.filtered-search'
)
filtered_search
.
set
(
'a'
)
filtered_search
.
set
(
'a'
)
hintStyle
=
page
.
find
(
'#js-dropdown-hint'
)[
'style'
]
hintStyle
=
page
.
find
(
'#js-dropdown-hint'
)[
'style'
]
hintOffset
=
getLeftStyle
(
hintStyle
)
hintOffset
=
getLeftStyle
(
hintStyle
)
...
...
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