Skip to content

Mock gitlab-ui popover directive and component

Vitaly Slobodin requested to merge add-mocks-for-popover into master

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

Availability and Testing

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

Merge request reports