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
8be02246
Commit
8be02246
authored
Aug 14, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start fixing js specs
parent
0472ff1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
12 deletions
+32
-12
spec/javascripts/boards/board_list_spec.js
spec/javascripts/boards/board_list_spec.js
+1
-0
spec/javascripts/boards/list_spec.js
spec/javascripts/boards/list_spec.js
+7
-5
spec/javascripts/boards/mock_data.js
spec/javascripts/boards/mock_data.js
+22
-7
spec/javascripts/filtered_search/dropdown_user_spec.js
spec/javascripts/filtered_search/dropdown_user_spec.js
+2
-0
No files found.
spec/javascripts/boards/board_list_spec.js
View file @
8be02246
...
...
@@ -32,6 +32,7 @@ describe('Board list component', () => {
const
list
=
new
List
(
listObj
);
const
issue
=
new
ListIssue
({
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[],
...
...
spec/javascripts/boards/list_spec.js
View file @
8be02246
...
...
@@ -97,6 +97,7 @@ describe('List model', () => {
const
listDup
=
new
List
(
listObjDuplicate
);
const
issue
=
new
ListIssue
({
title
:
'
Testing
'
,
id
:
_
.
random
(
10000
),
iid
:
_
.
random
(
10000
),
confidential
:
false
,
labels
:
[
list
.
label
,
listDup
.
label
],
...
...
@@ -123,7 +124,8 @@ describe('List model', () => {
for
(
let
i
=
0
;
i
<
30
;
i
+=
1
)
{
list
.
issues
.
push
(
new
ListIssue
({
title
:
'
Testing
'
,
iid
:
_
.
random
(
10000
)
+
i
,
id
:
_
.
random
(
10000
)
+
i
,
iid
:
_
.
random
(
1000
)
+
i
,
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
...
...
@@ -142,7 +144,7 @@ describe('List model', () => {
it
(
'
does not increase page number if issue count is less than the page size
'
,
()
=>
{
list
.
issues
.
push
(
new
ListIssue
({
title
:
'
Testing
'
,
i
i
d
:
_
.
random
(
10000
),
id
:
_
.
random
(
10000
),
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
...
...
@@ -161,7 +163,7 @@ describe('List model', () => {
spyOn
(
gl
.
boardService
,
'
newIssue
'
).
and
.
returnValue
(
Promise
.
resolve
({
json
()
{
return
{
i
i
d
:
42
,
id
:
42
,
};
},
}));
...
...
@@ -170,14 +172,14 @@ describe('List model', () => {
it
(
'
adds new issue to top of list
'
,
(
done
)
=>
{
list
.
issues
.
push
(
new
ListIssue
({
title
:
'
Testing
'
,
i
i
d
:
_
.
random
(
10000
),
id
:
_
.
random
(
10000
),
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
}));
const
dummyIssue
=
new
ListIssue
({
title
:
'
new issue
'
,
i
i
d
:
_
.
random
(
10000
),
id
:
_
.
random
(
10000
),
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
...
...
spec/javascripts/boards/mock_data.js
View file @
8be02246
...
...
@@ -34,7 +34,17 @@ const listObjDuplicate = {
const
BoardsMockData
=
{
'
GET
'
:
{
'
/test/issue-boards/board/1/lists{/id}/issues
'
:
{
'
/test/boards/1{/id}/issues
'
:
{
issues
:
[{
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[],
assignees
:
[],
}],
},
'
/boards/1{/id}/issues
'
:
{
issues
:
[{
title
:
'
Testing
'
,
id
:
1
,
...
...
@@ -51,7 +61,7 @@ const BoardsMockData = {
}],
},
'
POST
'
:
{
'
/
test/issue-boards/board/1/lists
{/id}
'
:
listObj
'
/
boards/1
{/id}
'
:
listObj
},
'
PUT
'
:
{
'
/test/issue-boards/board/1/lists{/id}
'
:
{}
...
...
@@ -76,11 +86,16 @@ window.BoardsMockData = BoardsMockData;
window
.
boardsMockInterceptor
=
boardsMockInterceptor
;
// eslint-disable-next-line import/prefer-default-export
export
function
mockBoardService
()
{
export
function
mockBoardService
(
opts
=
{})
{
const
boardsEndpoint
=
opts
.
boardsEndpoint
||
'
/test/issue-boards/board
'
;
const
listsEndpoint
=
opts
.
listsEndpoint
||
'
/test/boards/1
'
;
const
bulkUpdatePath
=
opts
.
bulkUpdatePath
||
''
;
const
boardId
=
opts
.
boardId
||
'
1
'
;
return
new
BoardService
({
boardsEndpoint
:
'
/test/issue-boards/board
'
,
listsEndpoint
:
'
/test/boards/1
'
,
bulkUpdatePath
:
''
,
boardId
:
'
1
'
,
boardsEndpoint
,
listsEndpoint
,
bulkUpdatePath
,
boardId
,
});
}
spec/javascripts/filtered_search/dropdown_user_spec.js
View file @
8be02246
...
...
@@ -10,6 +10,7 @@ describe('Dropdown User', () => {
beforeEach
(()
=>
{
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getGroupId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUtils
,
'
getSearchInput
'
).
and
.
callFake
(()
=>
{});
dropdownUser
=
new
gl
.
DropdownUser
({
...
...
@@ -38,6 +39,7 @@ describe('Dropdown User', () => {
beforeEach
(()
=>
{
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
bindEvents
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getProjectId
'
).
and
.
callFake
(()
=>
{});
spyOn
(
gl
.
DropdownUser
.
prototype
,
'
getGroupId
'
).
and
.
callFake
(()
=>
{});
});
it
(
'
should return endpoint
'
,
()
=>
{
...
...
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