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
906eb9e2
Commit
906eb9e2
authored
Nov 06, 2020
by
jakeburden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move sorting and sortingItems out of beforeEach
parent
ddbaaefe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
spec/frontend/releases/components/releases_sort_spec.js
spec/frontend/releases/components/releases_sort_spec.js
+3
-5
No files found.
spec/frontend/releases/components/releases_sort_spec.js
View file @
906eb9e2
...
...
@@ -46,22 +46,20 @@ describe('~/releases/components/releases_sort.vue', () => {
beforeEach
(()
=>
{
createComponent
();
sorting
=
findReleasesSorting
();
sortingItems
=
findSortingItems
();
});
it
(
'
has all the sortable items
'
,
()
=>
{
expect
(
sortingItems
).
toHaveLength
(
wrapper
.
vm
.
sortOptions
.
length
);
expect
(
findSortingItems
()
).
toHaveLength
(
wrapper
.
vm
.
sortOptions
.
length
);
});
it
(
'
on sort change set sorting in vuex and emit event
'
,
()
=>
{
sorting
.
vm
.
$emit
(
'
sortDirectionChange
'
);
findReleasesSorting
()
.
vm
.
$emit
(
'
sortDirectionChange
'
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
list/setSorting
'
,
{
sort
:
'
asc
'
});
expect
(
wrapper
.
emitted
(
'
sort:changed
'
)).
toBeTruthy
();
});
it
(
'
on sort item click set sorting and emit event
'
,
()
=>
{
const
item
=
sortingItems
.
at
(
0
);
const
item
=
findSortingItems
()
.
at
(
0
);
const
{
orderBy
}
=
wrapper
.
vm
.
sortOptions
[
0
];
item
.
vm
.
$emit
(
'
click
'
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
list/setSorting
'
,
{
orderBy
});
...
...
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