debian-mirror-gitlab/spec/frontend/helpers/stub_component.js
2021-02-22 17:27:13 +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,
};
}