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
cde9d182
Commit
cde9d182
authored
Oct 28, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate related items tree specs to Jest
parent
dd78e9b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
5 deletions
+23
-5
ee/spec/frontend/related_items_tree/components/related_items_tree_header_spec.js
...d_items_tree/components/related_items_tree_header_spec.js
+4
-1
ee/spec/frontend/related_items_tree/components/tree_item_body_spec.js
...tend/related_items_tree/components/tree_item_body_spec.js
+7
-2
ee/spec/frontend/related_items_tree/components/tree_item_spec.js
.../frontend/related_items_tree/components/tree_item_spec.js
+6
-2
spec/frontend/environment.js
spec/frontend/environment.js
+6
-0
No files found.
ee/spec/
javascripts
/related_items_tree/components/related_items_tree_header_spec.js
→
ee/spec/
frontend
/related_items_tree/components/related_items_tree_header_spec.js
View file @
cde9d182
...
...
@@ -8,7 +8,10 @@ import * as epicUtils from 'ee/related_items_tree/utils/epic_utils';
import
{
issuableTypesMap
}
from
'
ee/related_issues/constants
'
;
import
EpicActionsSplitButton
from
'
ee/related_items_tree/components/epic_actions_split_button.vue
'
;
import
{
mockParentItem
,
mockQueryResponse
}
from
'
../mock_data
'
;
import
{
mockParentItem
,
mockQueryResponse
,
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
const
createComponent
=
({
slots
}
=
{})
=>
{
const
store
=
createDefaultStore
();
...
...
ee/spec/
javascripts
/related_items_tree/components/tree_item_body_spec.js
→
ee/spec/
frontend
/related_items_tree/components/tree_item_body_spec.js
View file @
cde9d182
...
...
@@ -14,7 +14,12 @@ import createDefaultStore from 'ee/related_items_tree/store';
import
*
as
epicUtils
from
'
ee/related_items_tree/utils/epic_utils
'
;
import
{
ChildType
,
ChildState
}
from
'
ee/related_items_tree/constants
'
;
import
{
mockParentItem
,
mockInitialConfig
,
mockQueryResponse
,
mockIssue1
}
from
'
../mock_data
'
;
import
{
mockParentItem
,
mockInitialConfig
,
mockQueryResponse
,
mockIssue1
,
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
const
mockItem
=
Object
.
assign
({},
mockIssue1
,
{
type
:
ChildType
.
Issue
,
...
...
@@ -272,7 +277,7 @@ describe('RelatedItemsTree', () => {
describe
(
'
methods
'
,
()
=>
{
describe
(
'
handleRemoveClick
'
,
()
=>
{
it
(
'
calls `setRemoveItemModalProps` action with params `parentItem` and `item`
'
,
()
=>
{
spyOn
(
wrapper
.
vm
,
'
setRemoveItemModalProps
'
);
jest
.
spyOn
(
wrapper
.
vm
,
'
setRemoveItemModalProps
'
);
wrapper
.
vm
.
handleRemoveClick
();
...
...
ee/spec/
javascripts
/related_items_tree/components/tree_item_spec.js
→
ee/spec/
frontend
/related_items_tree/components/tree_item_spec.js
View file @
cde9d182
...
...
@@ -11,7 +11,11 @@ import createDefaultStore from 'ee/related_items_tree/store';
import
*
as
epicUtils
from
'
ee/related_items_tree/utils/epic_utils
'
;
import
{
ChildType
}
from
'
ee/related_items_tree/constants
'
;
import
{
mockParentItem
,
mockQueryResponse
,
mockEpic1
}
from
'
../mock_data
'
;
import
{
mockParentItem
,
mockQueryResponse
,
mockEpic1
,
}
from
'
../../../javascripts/related_items_tree/mock_data
'
;
const
mockItem
=
Object
.
assign
({},
mockEpic1
,
{
type
:
ChildType
.
Epic
,
...
...
@@ -114,7 +118,7 @@ describe('RelatedItemsTree', () => {
describe
(
'
methods
'
,
()
=>
{
describe
(
'
handleChevronClick
'
,
()
=>
{
it
(
'
calls `toggleItem` action with `item` as a param
'
,
()
=>
{
spyOn
(
wrapper
.
vm
,
'
toggleItem
'
);
jest
.
spyOn
(
wrapper
.
vm
,
'
toggleItem
'
);
wrapper
.
vm
.
handleChevronClick
();
...
...
spec/frontend/environment.js
View file @
cde9d182
...
...
@@ -41,6 +41,12 @@ class CustomEnvironment extends JSDOMEnvironment {
this
.
global
.
fixturesBasePath
=
`
${
ROOT_PATH
}
/tmp/tests/frontend/fixtures
${
IS_EE
?
'
-ee
'
:
''
}
`
;
this
.
global
.
staticFixturesBasePath
=
`
${
ROOT_PATH
}
/spec/frontend/fixtures`
;
/**
* window.fetch() is required by the apollo-upload-client library otherwise
* a ReferenceError is generated: https://github.com/jaydenseric/apollo-upload-client/issues/100
*/
this
.
global
.
fetch
=
()
=>
{};
// Not yet supported by JSDOM: https://github.com/jsdom/jsdom/issues/317
this
.
global
.
document
.
createRange
=
()
=>
({
setStart
:
()
=>
{},
...
...
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