Mock gitlab-ui tooltip directive and component
gitlab-ui tooltip component is based on bootstrap-vue tooltip component. Starting with bootstrap-vue 2.0, testing Vue components that use BV tooltip requires to attach the component under test to the document object using vue-test-utils attachToDocument mounting option. It also requires setting the `sync` option to true. This change affected a significant amount of unit tests in GitLab codebase. These effects impede GitLab from upgrading to bootstrap-vue 2.0. To address this problem we first attempted to fix all the affected tests. The list is broken tests is located in https://gitlab.com/gitlab-org/gitlab/merge_requests/18913. Over time, more tests appeared broken as they were using the tooltip directive too. The goal to fix broken tests became a moving target, so we desisted. This new approach mocks the tooltip directive and tooltip component to decouple the unit tests from the bootstrap-vue dependency.
Showing
Please register or sign in to comment