Skip to content

Migrate browser_spec to Jest

What does this MR do?

Migrate browser_spec.js to Jest. Since the original test relies on browser rendering this test was ported as an integration test. In addition, Karma runs this test in a real browser but this test depends on the getBoundingClientRect API which is not available in JSDom (it's available actually but it returns zero for all values) I took the following approach for the migration:

  1. I ran all tests in Karma and made notes where it calls getBoundingClientRect with values.
  2. I removed all redundant values from these calls
  3. I used these values to mock values in JSDom. So basically in current tests we mock initial values after the HTML was set and processed.

Closes #287678 (closed)

Screenshots or Screencasts (strongly suggested)

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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
Edited by Vitaly Slobodin

Merge request reports