Skip to content

chore(vue3): always stub gl-tooltip directive

Illya Klymov requested to merge xanf-road2vue3-mock-tooltip into main

What does this MR do?

Always stub gl-tooltip directive, like we do in gitlab-org/gitlab

One could ask - why do we stub tooltip for entire codebase, when it is used only in two tests

Well... The answer is - there are actually more components in gitlab-ui which render tooltips. And in Vue3 all of them will fail, when we're using shallowMount

More details for those who is interested

BootstrapVue tooltip directive works by creating new Vue component, and calling method updateData of this new component externally. This works well, till we use shallowMount - in Vue3 we are able to intercept creation of such new components (was not possible in Vue2 due to technical limitations how shallowMount is implemented). In Vue3 internal tooltip component will be stubbed.... and will fail complaining that there is no updateData method on stub

Since we even do not have tests for tooltips I feel like stubbing it is safe enough for our codebase

This is forward-compatible change to support @vue/compat #1981 (closed)

Does this MR meet the acceptance criteria?

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidlines.
  • If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • Added the ~"component:*" label(s) if applicable.

Merge request reports