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
b534a6c3
Commit
b534a6c3
authored
Jan 26, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for `updateIssueOrder`
parent
c6d126b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
17 deletions
+12
-17
spec/javascripts/issuable/related_issues/stores/related_issues_store_spec.js
...suable/related_issues/stores/related_issues_store_spec.js
+12
-17
No files found.
spec/javascripts/issuable/related_issues/stores/related_issues_store_spec.js
View file @
b534a6c3
import
RelatedIssuesStore
from
'
~/issuable/related_issues/stores/related_issues_store
'
;
const
issuable1
=
{
id
:
200
,
reference
:
'
foo/bar#123
'
,
title
:
'
issue1
'
,
path
:
'
/foo/bar/issues/123
'
,
state
:
'
opened
'
,
relation_path
:
'
/foo/bar/issues/123/related_issues/1
'
,
};
const
issuable2
=
{
id
:
201
,
reference
:
'
foo/bar#124
'
,
title
:
'
issue1
'
,
path
:
'
/foo/bar/issues/124
'
,
state
:
'
opened
'
,
relation_path
:
'
/foo/bar/issues/124/related_issues/1
'
,
};
import
{
issuable1
,
issuable2
,
issuable3
,
issuable4
,
issuable5
}
from
'
../mock_data
'
;
describe
(
'
RelatedIssuesStore
'
,
()
=>
{
let
store
;
...
...
@@ -58,6 +42,17 @@ describe('RelatedIssuesStore', () => {
});
});
describe
(
'
updateIssueOrder
'
,
()
=>
{
it
(
'
updates issue order
'
,
()
=>
{
const
relatedIssues
=
[
issuable1
,
issuable2
,
issuable3
,
issuable4
,
issuable5
];
store
.
state
.
relatedIssues
=
relatedIssues
;
expect
(
store
.
state
.
relatedIssues
[
3
].
id
).
toBe
(
issuable4
.
id
);
store
.
updateIssueOrder
(
3
,
0
);
expect
(
store
.
state
.
relatedIssues
[
0
].
id
).
toBe
(
issuable4
.
id
);
});
});
describe
(
'
setPendingReferences
'
,
()
=>
{
it
(
'
defaults to empty array
'
,
()
=>
{
expect
(
store
.
state
.
pendingReferences
).
toEqual
([]);
...
...
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