Commit fdc866a7 authored by Paul Slaughter's avatar Paul Slaughter

Merge branch 'nfriend-add-global-stubs' into 'master'

Allow `@gitlab/ui` mocks to apply to internal imports

See merge request gitlab-org/gitlab!36014
parents 617aa2c4 f79f4336
......@@ -7,22 +7,23 @@ export * from '@gitlab/ui';
*
* This mock decouples those tests from the implementation, removing the need to set
* them up specially just for these tooltips.
*
* Mocking the modules using the full file path allows the mocks to take effect
* when the modules are imported in this project (`gitlab`) **and** when they
* are imported internally in `@gitlab/ui`.
*/
export const GlTooltipDirective = {
jest.mock('@gitlab/ui/dist/directives/tooltip.js', () => ({
bind() {},
};
}));
export const GlTooltip = {
jest.mock('@gitlab/ui/dist/components/base/tooltip/tooltip.js', () => ({
render(h) {
return h('div', this.$attrs, this.$slots.default);
},
};
export const GlPopoverDirective = {
bind() {},
};
}));
export const GlPopover = {
jest.mock('@gitlab/ui/dist/components/base/popover/popover.js', () => ({
props: {
cssClasses: {
type: Array,
......@@ -33,4 +34,4 @@ export const GlPopover = {
render(h) {
return h('div', this.$attrs, Object.keys(this.$slots).map(s => this.$slots[s]));
},
};
}));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment