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
d030a54e
Commit
d030a54e
authored
May 09, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a flaky spec for sorting projects in dashboard
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
6b2f4ea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
44 deletions
+12
-44
spec/features/dashboard/user_filters_projects_spec.rb
spec/features/dashboard/user_filters_projects_spec.rb
+12
-44
No files found.
spec/features/dashboard/user_filters_projects_spec.rb
View file @
d030a54e
...
...
@@ -151,34 +151,22 @@ describe 'Dashboard > User filters projects' do
end
describe
'Sorting'
do
before
do
[
{
name:
'Red ribbon army'
,
created_at:
2
.
days
.
ago
},
{
name:
'Cell saga'
,
created_at:
Time
.
now
},
{
name:
'Frieza saga'
,
created_at:
10
.
days
.
ago
}
].
each
do
|
item
|
project
=
create
(
:project
,
name:
item
[
:name
],
namespace:
user
.
namespace
,
created_at:
item
[
:created_at
])
project
.
add_developer
(
user
)
end
let
(
:desc_sorted_project_names
)
{
%w[Treasure Victorialand]
}
before
do
user
.
toggle_star
(
project
)
user
.
toggle_star
(
project2
)
user2
.
toggle_star
(
project2
)
end
it
'
includes sorting direction'
do
it
'
has all sorting options'
,
:js
do
sorting_dropdown
=
page
.
find
(
'.filtered-search-block #filtered-search-sorting-dropdown'
)
expect
(
sorting_dropdown
).
to
have_css
'.reverse-sort-btn'
end
it
'has all sorting options'
,
:js
do
sorting_dropdown
=
page
.
find
(
'.filtered-search-block #filtered-search-sorting-dropdown'
)
sorting_option_labels
=
[
'Last updated'
,
'Created date'
,
'Name'
,
'Stars'
]
sorting_dropdown
.
click
sorting_option_labels
.
each
do
|
label
|
[
'Last updated'
,
'Created date'
,
'Name'
,
'Stars'
]
.
each
do
|
label
|
expect
(
sorting_dropdown
).
to
have_content
(
label
)
end
end
...
...
@@ -194,16 +182,11 @@ describe 'Dashboard > User filters projects' do
it
'sorts the project list'
do
select_dropdown_option
'#filtered-search-sorting-dropdown'
,
'Name'
desc
=
[
'Victorialand'
,
'Treasure'
,
'Red ribbon army'
,
'Frieza saga'
,
'Cell saga'
]
asc
=
[
'Cell saga'
,
'Frieza saga'
,
'Red ribbon army'
,
'Treasure'
,
'Victorialand'
]
click_sort_direction
expect_to_see_projects
(
desc
)
expect_to_see_projects
(
desc_sorted_project_names
)
click_sort_direction
expect_to_see_projects
(
asc
)
expect_to_see_projects
(
desc_sorted_project_names
.
reverse
)
end
end
...
...
@@ -211,16 +194,11 @@ describe 'Dashboard > User filters projects' do
it
'sorts the project list'
do
select_dropdown_option
'#filtered-search-sorting-dropdown'
,
'Last updated'
desc
=
[
"Frieza saga"
,
"Red ribbon army"
,
"Victorialand"
,
"Treasure"
,
"Cell saga"
]
asc
=
[
"Cell saga"
,
"Treasure"
,
"Victorialand"
,
"Red ribbon army"
,
"Frieza saga"
]
expect_to_see_projects
(
desc_sorted_project_names
)
click_sort_direction
expect_to_see_projects
(
desc
)
click_sort_direction
expect_to_see_projects
(
asc
)
expect_to_see_projects
(
desc_sorted_project_names
.
reverse
)
end
end
...
...
@@ -228,16 +206,11 @@ describe 'Dashboard > User filters projects' do
it
'sorts the project list'
do
select_dropdown_option
'#filtered-search-sorting-dropdown'
,
'Created date'
desc
=
[
"Frieza saga"
,
"Red ribbon army"
,
"Victorialand"
,
"Treasure"
,
"Cell saga"
]
asc
=
[
"Cell saga"
,
"Treasure"
,
"Victorialand"
,
"Red ribbon army"
,
"Frieza saga"
]
click_sort_direction
expect_to_see_projects
(
desc
)
expect_to_see_projects
(
desc_sorted_project_names
)
click_sort_direction
expect_to_see_projects
(
asc
)
expect_to_see_projects
(
desc_sorted_project_names
.
reverse
)
end
end
...
...
@@ -245,16 +218,11 @@ describe 'Dashboard > User filters projects' do
it
'sorts the project list'
do
select_dropdown_option
'#filtered-search-sorting-dropdown'
,
'Stars'
desc
=
[
"Red ribbon army"
,
"Cell saga"
,
"Frieza saga"
,
"Victorialand"
,
"Treasure"
]
asc
=
[
"Treasure"
,
"Victorialand"
,
"Red ribbon army"
,
"Cell saga"
,
"Frieza saga"
]
click_sort_direction
expect_to_see_projects
(
desc
)
expect_to_see_projects
(
desc_sorted_project_names
)
click_sort_direction
expect_to_see_projects
(
asc
)
expect_to_see_projects
(
desc_sorted_project_names
.
reverse
)
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