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
7181b345
Commit
7181b345
authored
Mar 27, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue-boards-test-fix' into 'master'
Fixed up issue boards JS specs Closes #29329 See merge request !10215
parents
8391fa37
88280aa6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
boards_store_spec.js
spec/javascripts/boards/boards_store_spec.js
+7
-7
list_spec.js
spec/javascripts/boards/list_spec.js
+5
-5
mock_data.js
spec/javascripts/boards/mock_data.js
+4
-4
No files found.
spec/javascripts/boards/boards_store_spec.js
View file @
7181b345
...
...
@@ -50,9 +50,9 @@ describe('Store', () => {
it
(
'finds list by ID'
,
()
=>
{
gl
.
issueBoards
.
BoardsStore
.
addList
(
listObj
);
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
1
);
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
listObj
.
id
);
expect
(
list
.
id
).
toBe
(
1
);
expect
(
list
.
id
).
toBe
(
listObj
.
id
);
});
it
(
'finds list by type'
,
()
=>
{
...
...
@@ -64,7 +64,7 @@ describe('Store', () => {
it
(
'gets issue when new list added'
,
(
done
)
=>
{
gl
.
issueBoards
.
BoardsStore
.
addList
(
listObj
);
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
1
);
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
listObj
.
id
);
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
1
);
...
...
@@ -89,9 +89,9 @@ describe('Store', () => {
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
1
);
setTimeout
(()
=>
{
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
1
);
const
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
listObj
.
id
);
expect
(
list
).
toBeDefined
();
expect
(
list
.
id
).
toBe
(
1
);
expect
(
list
.
id
).
toBe
(
listObj
.
id
);
expect
(
list
.
position
).
toBe
(
0
);
done
();
},
0
);
...
...
@@ -126,7 +126,7 @@ describe('Store', () => {
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
1
);
gl
.
issueBoards
.
BoardsStore
.
removeList
(
1
,
'label'
);
gl
.
issueBoards
.
BoardsStore
.
removeList
(
listObj
.
id
,
'label'
);
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
0
);
});
...
...
@@ -137,7 +137,7 @@ describe('Store', () => {
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
2
);
gl
.
issueBoards
.
BoardsStore
.
moveList
(
listOne
,
[
'2'
,
'1'
]);
gl
.
issueBoards
.
BoardsStore
.
moveList
(
listOne
,
[
listObjDuplicate
.
id
,
listObj
.
id
]);
expect
(
listOne
.
position
).
toBe
(
1
);
});
...
...
spec/javascripts/boards/list_spec.js
View file @
7181b345
...
...
@@ -43,7 +43,7 @@ describe('List model', () => {
list
=
new
List
({
title
:
'test'
,
label
:
{
id
:
1
,
id
:
_
.
random
(
10000
)
,
title
:
'test'
,
color
:
'red'
}
...
...
@@ -51,7 +51,7 @@ describe('List model', () => {
list
.
save
();
setTimeout
(()
=>
{
expect
(
list
.
id
).
toBe
(
1
);
expect
(
list
.
id
).
toBe
(
listObj
.
id
);
expect
(
list
.
type
).
toBe
(
'label'
);
expect
(
list
.
position
).
toBe
(
0
);
done
();
...
...
@@ -60,7 +60,7 @@ describe('List model', () => {
it
(
'destroys the list'
,
(
done
)
=>
{
gl
.
issueBoards
.
BoardsStore
.
addList
(
listObj
);
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
1
);
list
=
gl
.
issueBoards
.
BoardsStore
.
findList
(
'id'
,
listObj
.
id
);
expect
(
gl
.
issueBoards
.
BoardsStore
.
state
.
lists
.
length
).
toBe
(
1
);
list
.
destroy
();
...
...
@@ -92,7 +92,7 @@ describe('List model', () => {
const
listDup
=
new
List
(
listObjDuplicate
);
const
issue
=
new
ListIssue
({
title
:
'Testing'
,
iid
:
1
,
iid
:
_
.
random
(
10000
)
,
confidential
:
false
,
labels
:
[
list
.
label
,
listDup
.
label
]
});
...
...
@@ -102,7 +102,7 @@ describe('List model', () => {
spyOn
(
gl
.
boardService
,
'moveIssue'
).
and
.
callThrough
();
listDup
.
updateIssueLabel
(
list
,
issue
);
listDup
.
updateIssueLabel
(
issue
,
list
);
expect
(
gl
.
boardService
.
moveIssue
)
.
toHaveBeenCalledWith
(
issue
.
id
,
list
.
id
,
listDup
.
id
,
undefined
,
undefined
);
...
...
spec/javascripts/boards/mock_data.js
View file @
7181b345
/* eslint-disable comma-dangle, no-unused-vars, quote-props */
const
listObj
=
{
id
:
1
,
id
:
_
.
random
(
10000
)
,
position
:
0
,
title
:
'Test'
,
list_type
:
'label'
,
label
:
{
id
:
1
,
id
:
_
.
random
(
10000
)
,
title
:
'Testing'
,
color
:
'red'
,
description
:
'testing;'
...
...
@@ -14,12 +14,12 @@ const listObj = {
};
const
listObjDuplicate
=
{
id
:
2
,
id
:
listObj
.
id
,
position
:
1
,
title
:
'Test'
,
list_type
:
'label'
,
label
:
{
id
:
2
,
id
:
listObj
.
label
.
id
,
title
:
'Testing'
,
color
:
'red'
,
description
:
'testing;'
...
...
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