Improve issue specs
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
- [-] 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