debian-mirror-gitlab/spec/frontend/__helpers__/stub_component.js

13 lines
405 B
JavaScript
Raw Normal View History

2021-02-22 17:27:13 +05:30
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,
};
}