Remove snapshots from security dashboard integration tests

What does this MR do and why?

Related #558227 (closed)

Remove snapshots from security dashboard integration tests

This refactors the security dashboard integration tests in the following way:

  1. Go from snapshot based approach, to checking if the correct component is loaded
  2. Change the structure of the spec so it follows the group, project, and instance levels
  3. Check for the non-configured empty state as well

It also fixes a bug for the not configured project level component. The newVulnerabilityPath and canAdminVulnerability properties were not being provided. This caused an error because it is expected. And this also caused the Submit vulnerability button not never show up.

Changelog: fixed EE: true

References

Screenshots or screen recordings

Before After
Screenshot_2025-08-04_at_18.12.50 Screenshot_2025-08-04_at_18.07.29

How to set up and validate locally

For refactor:

Run yarn jest:integration ee/spec/frontend_integration/security_dashboard/security_dashboard_init_integration_spec.js

For bugfix:

Go to security dashboard of a project without vulnerabilities. Notice it has a "Submit vulnerability" button at the top.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading