summaryrefslogtreecommitdiff
path: root/spec/frontend/__mocks__/@gitlab/ui.js
blob: 7f893bf7ed718daaed5fdb0ba96961cc8f9e5c83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export * from '@gitlab/ui';

/**
 * The @gitlab/ui tooltip directive requires awkward and distracting set up in tests
 * for components that use it (e.g., `attachToDocument: true` and `sync: true` passed
 * to the `mount` helper from `vue-test-utils`).
 *
 * This mock decouples those tests from the implementation, removing the need to set
 * them up specially just for these tooltips.
 */
export const GlTooltipDirective = {
  bind() {},
};

export const GlTooltip = {
  render(h) {
    return h('div', this.$attrs, this.$slots.default);
  },
};

export const GlPopoverDirective = {
  bind() {},
};

export const GlPopover = {
  props: {
    cssClasses: {
      type: Array,
      required: false,
      default: () => [],
    },
  },
  render(h) {
    return h('div', this.$attrs, this.$slots.default);
  },
};