debian-mirror-gitlab/spec/frontend/__helpers__/stub_component.js
2021-03-08 18:12:59 +05:30

12 lines
405 B
JavaScript

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,
};
}