diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-16 21:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-16 21:10:10 +0300 |
commit | d755061465c24de58568183df5e7b826e934ae5d (patch) | |
tree | b378078e37c3ae384ea7e3b7ca91398754fd7fac /spec/frontend/helpers | |
parent | 6364c14cc1f445d471bca118dca5af5a85b2c5dc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/helpers')
-rw-r--r-- | spec/frontend/helpers/stub_component.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/frontend/helpers/stub_component.js b/spec/frontend/helpers/stub_component.js new file mode 100644 index 00000000000..45550450517 --- /dev/null +++ b/spec/frontend/helpers/stub_component.js @@ -0,0 +1,12 @@ +export function stubComponent(Component, options = {}) { + return { + props: Component.props, + model: Component.model, + // Do not render any slots/scoped slots except default + // This differs from VTU behavior which renders all slots + template: '<div><slot></slot></div>', + // allows wrapper.find(Component) to work for stub + $_vueTestUtils_original: Component, + ...options, + }; +} |