Skip to content

Improve issue specs

Greg Johnson requested to merge (removed):improve-issue-specs into master

Background and Context

This MR is a legitimate replacement for !49631 (closed). Though red team initially created !49631 (closed) to further an operation testing our ability to respond to one form of a supply chain attack, we tried to make the MR as attractive as possible by creating legitimately beneficial code changes to go along with it. Contained are the legitimate code changes by themselves for the benefit of the GitLab code base.

What does this MR do?

This MR attempts to make improvements on specs/frontend/issue_spec.js on top of the already beneficial changes made with a previous MR specs/frontend/issue_spec.js legacy specs. This MR was inspired by previous discussions on a recently closed issue and MR where we were exploring ways to remove some tech debt in the legacy code and improve the related testing. The end result will make the tests more easily maintainable by making them more consistent with other front-end specs (search for: from '@testing-library/dom'; in your favorite editor), as well as encouraging better DOM coding practices supported by the @testing-library/* set of dependencies in future tested features.

The specific goals achieved in the MR are:

  • Keep coverage equivalent
  • Scope assertions to test functions
  • Leverage jest life-cycle test functions vs. custom functions/iterators where possible
  • Ration DRYing of the test code to keep the testing intent clear and easily understandable
  • Remove the jQuery dependency in order to leverage @testing-libary/dom paradigm implemented in many other front-end specs

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
Edited by Greg Johnson

Merge request reports