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
479ed28f
Commit
479ed28f
authored
Jan 18, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to handle swapping of items
parent
0d626bda
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
spec/javascripts/issuable/related_issues/components/related_issues_block_spec.js
...le/related_issues/components/related_issues_block_spec.js
+23
-6
No files found.
spec/javascripts/issuable/related_issues/components/related_issues_block_spec.js
View file @
479ed28f
...
@@ -42,6 +42,16 @@ const issuable4 = {
...
@@ -42,6 +42,16 @@ const issuable4 = {
state
:
'
opened
'
,
state
:
'
opened
'
,
};
};
const
issuable5
=
{
id
:
204
,
epic_issue_id
:
5
,
reference
:
'
foo/bar#127
'
,
displayReference
:
'
#127
'
,
title
:
'
some other other other thing
'
,
path
:
'
/foo/bar/issues/127
'
,
state
:
'
opened
'
,
};
describe
(
'
RelatedIssuesBlock
'
,
()
=>
{
describe
(
'
RelatedIssuesBlock
'
,
()
=>
{
let
RelatedIssuesBlock
;
let
RelatedIssuesBlock
;
let
vm
;
let
vm
;
...
@@ -148,6 +158,7 @@ describe('RelatedIssuesBlock', () => {
...
@@ -148,6 +158,7 @@ describe('RelatedIssuesBlock', () => {
issuable2
,
issuable2
,
issuable3
,
issuable3
,
issuable4
,
issuable4
,
issuable5
,
],
],
},
},
}).
$mount
();
}).
$mount
();
...
@@ -160,21 +171,27 @@ describe('RelatedIssuesBlock', () => {
...
@@ -160,21 +171,27 @@ describe('RelatedIssuesBlock', () => {
});
});
it
(
'
reorder item correctly when an item is moved to the top
'
,
()
=>
{
it
(
'
reorder item correctly when an item is moved to the top
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
0
,
3
);
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:first-child
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBeNull
();
expect
(
beforeAfterIds
.
beforeId
).
toBeNull
();
expect
(
beforeAfterIds
.
afterId
).
toBe
(
1
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
2
);
});
});
it
(
'
reorder item correctly when an item is moved to the bottom
'
,
()
=>
{
it
(
'
reorder item correctly when an item is moved to the bottom
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
3
,
3
);
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:last-child
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
4
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
4
);
expect
(
beforeAfterIds
.
afterId
).
toBeNull
();
expect
(
beforeAfterIds
.
afterId
).
toBeNull
();
});
});
it
(
'
reorder item correctly when an item is
moved somewhere in the middle
'
,
()
=>
{
it
(
'
reorder item correctly when an item is
swapped with adjecent item
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
2
,
3
);
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:nth-child(3)
'
)
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
2
);
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
2
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
3
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
4
);
});
it
(
'
reorder item correctly when an item is moved somewhere in the middle
'
,
()
=>
{
const
beforeAfterIds
=
vm
.
getBeforeAfterId
(
vm
.
$el
.
querySelector
(
'
ul li:nth-child(4)
'
));
expect
(
beforeAfterIds
.
beforeId
).
toBe
(
3
);
expect
(
beforeAfterIds
.
afterId
).
toBe
(
5
);
});
});
it
(
'
when expanding add related issue form
'
,
()
=>
{
it
(
'
when expanding add related issue form
'
,
()
=>
{
...
...
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