diff --git a/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts b/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts index aa2887a04da21..8f2a2fa2693d4 100644 --- a/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts +++ b/x-pack/test/cloud_security_posture_api/routes/vulnerabilities_dashboard.ts @@ -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`)