BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6b662718
Commit
6b662718
authored
Oct 19, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use count expectation so `all` finder will wait (patience)
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/34435
Address flakey specs
parent
bba020a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
recent_searches_spec.rb
spec/features/issues/filtered_search/recent_searches_spec.rb
+7
-13
No files found.
spec/features/issues/filtered_search/recent_searches_spec.rb
View file @
6b662718
...
...
@@ -27,9 +27,8 @@ describe 'Recent searches', :js do
input_filtered_search
(
'foo'
,
submit:
true
)
input_filtered_search
(
'bar'
,
submit:
true
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
2
)
expect
(
items
.
count
).
to
eq
(
2
)
expect
(
items
[
0
].
text
).
to
eq
(
'bar'
)
expect
(
items
[
1
].
text
).
to
eq
(
'foo'
)
end
...
...
@@ -38,9 +37,8 @@ describe 'Recent searches', :js do
visit
project_issues_path
(
project_1
,
label_name:
'foo'
,
search:
'bar'
)
visit
project_issues_path
(
project_1
,
label_name:
'qux'
,
search:
'garply'
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
2
)
expect
(
items
.
count
).
to
eq
(
2
)
expect
(
items
[
0
].
text
).
to
eq
(
'label:~qux garply'
)
expect
(
items
[
1
].
text
).
to
eq
(
'label:~foo bar'
)
end
...
...
@@ -50,9 +48,8 @@ describe 'Recent searches', :js do
visit
project_issues_path
(
project_1
,
search:
'foo'
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
3
)
expect
(
items
.
count
).
to
eq
(
3
)
expect
(
items
[
0
].
text
).
to
eq
(
'foo'
)
expect
(
items
[
1
].
text
).
to
eq
(
'saved1'
)
expect
(
items
[
2
].
text
).
to
eq
(
'saved2'
)
...
...
@@ -69,9 +66,8 @@ describe 'Recent searches', :js do
input_filtered_search
(
'more'
,
submit:
true
)
input_filtered_search
(
'things'
,
submit:
true
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
items
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
2
)
expect
(
items
.
count
).
to
eq
(
2
)
expect
(
items
[
0
].
text
).
to
eq
(
'things'
)
expect
(
items
[
1
].
text
).
to
eq
(
'more'
)
end
...
...
@@ -80,7 +76,7 @@ describe 'Recent searches', :js do
set_recent_searches
(
project_1_local_storage_key
,
'["foo", "bar"]'
)
visit
project_issues_path
(
project_1
)
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)[
0
].
trigger
(
'click'
)
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
2
)[
0
].
trigger
(
'click'
)
wait_for_filtered_search
(
'foo'
)
expect
(
find
(
'.filtered-search'
).
value
.
strip
).
to
eq
(
'foo'
)
...
...
@@ -90,12 +86,10 @@ describe 'Recent searches', :js do
set_recent_searches
(
project_1_local_storage_key
,
'["foo"]'
)
visit
project_issues_path
(
project_1
)
items_before
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
expect
(
items_before
.
count
).
to
eq
(
1
)
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
1
)
find
(
'.filtered-search-history-clear-button'
,
visible:
false
).
trigger
(
'click'
)
items_after
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
)
items_after
=
all
(
'.filtered-search-history-dropdown-item'
,
visible:
false
,
count:
0
)
expect
(
items_after
.
count
).
to
eq
(
0
)
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