Mock gitlab-ui popover directive and component
What does this MR do?
Mock GlPopover
for tests also. See 06bd4dbd for more information or below.
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.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team