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
16d431fc
Commit
16d431fc
authored
Jun 06, 2020
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate ee/boards specs to Jest
Migrate specs in ee/spec/javascripts/boards to Jest
parent
b146cfda
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
+24
-13
ee/app/assets/javascripts/boards/components/assignee_select.vue
.../assets/javascripts/boards/components/assignee_select.vue
+1
-0
ee/spec/frontend/boards/components/assignee_select_spec.js
ee/spec/frontend/boards/components/assignee_select_spec.js
+6
-4
ee/spec/frontend/boards/components/board_list_spec.js
ee/spec/frontend/boards/components/board_list_spec.js
+1
-0
ee/spec/frontend/boards/milestone_select_spec.js
ee/spec/frontend/boards/milestone_select_spec.js
+16
-9
No files found.
ee/app/assets/javascripts/boards/components/assignee_select.vue
View file @
16d431fc
<
script
>
import
'
~/gl_dropdown
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
__
}
from
'
~/locale
'
;
import
UsersSelect
from
'
~/users_select
'
;
...
...
ee/spec/
javascripts
/boards/components/assignee_select_spec.js
→
ee/spec/
frontend
/boards/components/assignee_select_spec.js
View file @
16d431fc
...
...
@@ -2,7 +2,7 @@ import MockAdapter from 'axios-mock-adapter';
import
Vue
from
'
vue
'
;
import
AssigneeSelect
from
'
ee/boards/components/assignee_select.vue
'
;
import
{
boardObj
}
from
'
spec
/boards/mock_data
'
;
import
{
boardObj
}
from
'
jest
/boards/mock_data
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
boardsStore
from
'
~/boards/stores/boards_store
'
;
...
...
@@ -51,7 +51,7 @@ describe('Assignee select component', () => {
},
}).
$mount
(
'
.test-container
'
);
set
Timeout
(
done
);
set
Immediate
(
done
);
});
describe
(
'
canEdit
'
,
()
=>
{
...
...
@@ -100,10 +100,12 @@ describe('Assignee select component', () => {
it
(
'
sets assignee
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
.edit-link
'
).
click
();
setTimeout
(()
=>
{
jest
.
runOnlyPendingTimers
();
setImmediate
(()
=>
{
vm
.
$el
.
querySelectorAll
(
'
li a
'
)[
2
].
click
();
set
Timeout
(()
=>
{
set
Immediate
(()
=>
{
expect
(
activeDropdownItem
(
0
)).
toEqual
(
'
second assignee
'
);
expect
(
vm
.
board
.
assignee
).
toEqual
(
assignee2
);
done
();
...
...
ee/spec/
javascripts
/boards/components/board_list_spec.js
→
ee/spec/
frontend
/boards/components/board_list_spec.js
View file @
16d431fc
...
...
@@ -9,6 +9,7 @@ describe('BoardList Component', () => {
project
:
{
path
:
'
/test
'
,
},
real_path
:
''
,
};
const
componentProps
=
{
...
...
ee/spec/
javascripts
/boards/milestone_select_spec.js
→
ee/spec/
frontend
/boards/milestone_select_spec.js
View file @
16d431fc
import
Vue
from
'
vue
'
;
import
MockAdapater
from
'
axios-mock-adapter
'
;
import
MilestoneSelect
from
'
ee/boards/components/milestone_select.vue
'
;
import
{
boardObj
}
from
'
spec
/boards/mock_data
'
;
import
{
boardObj
}
from
'
jest
/boards/mock_data
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
IssuableContext
from
'
~/issuable_context
'
;
...
...
@@ -45,7 +45,7 @@ describe('Milestone select component', () => {
},
}).
$mount
(
'
.test-container
'
);
set
Timeout
(
done
);
set
Immediate
(
done
);
});
describe
(
'
canEdit
'
,
()
=>
{
...
...
@@ -103,15 +103,18 @@ describe('Milestone select component', () => {
mock
.
restore
();
});
it
(
'
sets Any milestone
'
,
done
=>
{
it
(
'
sets Any milestone
'
,
async
done
=>
{
vm
.
board
.
milestone_id
=
0
;
vm
.
$el
.
querySelector
(
'
.edit-link
'
).
click
();
setTimeout
(()
=>
{
await
vm
.
$nextTick
();
jest
.
runOnlyPendingTimers
();
setImmediate
(()
=>
{
vm
.
$el
.
querySelectorAll
(
'
li a
'
)[
0
].
click
();
});
set
Timeout
(()
=>
{
set
Immediate
(()
=>
{
expect
(
activeDropdownItem
(
0
)).
toEqual
(
'
Any milestone
'
);
expect
(
selectedText
()).
toEqual
(
'
Any milestone
'
);
done
();
...
...
@@ -121,11 +124,13 @@ describe('Milestone select component', () => {
it
(
'
sets No milestone
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
.edit-link
'
).
click
();
setTimeout
(()
=>
{
jest
.
runOnlyPendingTimers
();
setImmediate
(()
=>
{
vm
.
$el
.
querySelectorAll
(
'
li a
'
)[
1
].
click
();
});
set
Timeout
(()
=>
{
set
Immediate
(()
=>
{
expect
(
activeDropdownItem
(
0
)).
toEqual
(
'
No milestone
'
);
expect
(
selectedText
()).
toEqual
(
'
No milestone
'
);
done
();
...
...
@@ -135,11 +140,13 @@ describe('Milestone select component', () => {
it
(
'
sets milestone
'
,
done
=>
{
vm
.
$el
.
querySelector
(
'
.edit-link
'
).
click
();
setTimeout
(()
=>
{
jest
.
runOnlyPendingTimers
();
setImmediate
(()
=>
{
vm
.
$el
.
querySelectorAll
(
'
li a
'
)[
4
].
click
();
});
set
Timeout
(()
=>
{
set
Immediate
(()
=>
{
expect
(
activeDropdownItem
(
0
)).
toEqual
(
'
first milestone
'
);
expect
(
selectedText
()).
toEqual
(
'
first milestone
'
);
expect
(
vm
.
board
.
milestone
).
toEqual
(
milestone
);
...
...
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