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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
6d330015
Commit
6d330015
authored
Mar 23, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy vue_mount_component_helper.js to Jest
parent
09d25b04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
spec/frontend/helpers/vue_mount_component_helper.js
spec/frontend/helpers/vue_mount_component_helper.js
+38
-0
No files found.
spec/frontend/helpers/vue_mount_component_helper.js
0 → 100644
View file @
6d330015
import
Vue
from
'
vue
'
;
const
mountComponent
=
(
Component
,
props
=
{},
el
=
null
)
=>
new
Component
({
propsData
:
props
,
}).
$mount
(
el
);
export
const
createComponentWithStore
=
(
Component
,
store
,
propsData
=
{})
=>
new
Component
({
store
,
propsData
,
});
export
const
mountComponentWithStore
=
(
Component
,
{
el
,
props
,
store
})
=>
new
Component
({
store
,
propsData
:
props
||
{},
}).
$mount
(
el
);
export
const
mountComponentWithSlots
=
(
Component
,
{
props
,
slots
})
=>
{
const
component
=
new
Component
({
propsData
:
props
||
{},
});
component
.
$slots
=
slots
;
return
component
.
$mount
();
};
/**
* Mount a component with the given render method.
*
* This helps with inserting slots that need to be compiled.
*/
export
const
mountComponentWithRender
=
(
render
,
el
=
null
)
=>
mountComponent
(
Vue
.
extend
({
render
}),
{},
el
);
export
default
mountComponent
;
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