[8.15] [Cloud Security] fix vulnerability dashboard ftr flaky test (#187790) (#187912)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[Cloud Security] fix vulnerability dashboard ftr flaky test
(#187790)](https://github.com/elastic/kibana/pull/187790)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Lola","email":"omolola.akinleye@elastic.co"},"sourceCommit":{"committedDate":"2024-07-09T19:21:19Z","message":"[Cloud
Security] fix vulnerability dashboard ftr flaky test (#187790)\n\n##
Summary\r\n\r\nSummarize your PR. If it involves visual changes include
a screenshot or\r\ngif.\r\nFix Flaky Vulnerability Dashboard
Test","sha":"4b8ba30dd429131a280ec7df9bf21a02480063a4","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Cloud
Security","v8.15.0","v8.16.0"],"title":"[Cloud Security] fix
vulnerability dashboard ftr flaky
test","number":187790,"url":"https://github.com/elastic/kibana/pull/187790","mergeCommit":{"message":"[Cloud
Security] fix vulnerability dashboard ftr flaky test (#187790)\n\n##
Summary\r\n\r\nSummarize your PR. If it involves visual changes include
a screenshot or\r\ngif.\r\nFix Flaky Vulnerability Dashboard
Test","sha":"4b8ba30dd429131a280ec7df9bf21a02480063a4"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187790","number":187790,"mergeCommit":{"message":"[Cloud
Security] fix vulnerability dashboard ftr flaky test (#187790)\n\n##
Summary\r\n\r\nSummarize your PR. If it involves visual changes include
a screenshot or\r\ngif.\r\nFix Flaky Vulnerability Dashboard
Test","sha":"4b8ba30dd429131a280ec7df9bf21a02480063a4"}}]}] BACKPORT-->

Co-authored-by: Lola <omolola.akinleye@elastic.co>
This commit is contained in:
Kibana Machine 2024-07-09 22:56:09 +02:00 committed by GitHub
parent d9269b6b53
commit 1e231f836d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,16 +186,13 @@ export default function ({ getService }: FtrProviderContext) {
describe('Vulnerability Dashboard API', async () => {
beforeEach(async () => {
await index.removeFindings();
await index.removeScores();
await waitForPluginInitialized();
await index.addScores(scoresVulnerabilitiesMock);
await index.addFindings(vulnerabilitiesLatestMock);
});
afterEach(async () => {
await index.removeFindings();
await index.removeScores();
});
it('responds with a 200 status code and matching data mock', async () => {
const { body } = await supertest
.get(`/internal/cloud_security_posture/vulnerabilities_dashboard`)