Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (testing): Consider making the test resilient to ordering changes when vulnerabilities share the same severity.
The test currently depends on the exact order of the two critical vulnerabilities. Since the backend has already changed this once, it would be more robust to assert that both critical CVEs appear in the "top" vulnerabilities section (and are marked as critical) without relying on their relative order—unless the product explicitly guarantees a specific sort criterion. If ordering is guaranteed, please add a brief comment in the test documenting the expected sort key so future backend changes don’t unintentionally break CI.
Suggested implementation:
To fully implement the suggestion and make the test resilient to ordering changes:
expect(renderedTopVulns).toEqual(EXPECTED_TOP_3), use a combination of:expect(renderedTopVulns).toEqual(expect.arrayContaining(EXPECTED_TOP_3));if you only care about membership, orexpect(renderedTopVulns.map(v => v.identifier)).toEqual(expect.arrayContaining(EXPECTED_CRITICAL_TOP_VULNERABILITIES.map(v => v.identifier)));plus explicit severity checks per item.
EXPECTED_CRITICAL_TOP_VULNERABILITIESappear in the "top vulnerabilities" section./critical/iseverity).severity desc, exploitability desc, identifier asc), add a short inline comment near the assertion documenting that sort criterion so backend changes do not unintentionally break CI.