From c5f9d683aa8d878b40c47ad3ff58bb47f9bcc0f8 Mon Sep 17 00:00:00 2001 From: Janson Bunce Date: Thu, 22 Aug 2024 11:28:23 -0700 Subject: [PATCH] resolve failing stats test --- backend/test/__snapshots__/stats.test.ts.snap | 4 ++-- backend/test/stats.test.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/test/__snapshots__/stats.test.ts.snap b/backend/test/__snapshots__/stats.test.ts.snap index df2f02e5..e825ef0c 100644 --- a/backend/test/__snapshots__/stats.test.ts.snap +++ b/backend/test/__snapshots__/stats.test.ts.snap @@ -98,7 +98,7 @@ Object { } `; -exports[`stats get get by org user should return only domains from that org 1`] = ` +exports[`stats get get by orgs user should return only domains from those orgs 1`] = ` Object { "domains": Object { "numVulnerabilities": Array [ @@ -122,7 +122,7 @@ Object { "value": 1, }, ], - "total": 2, + "total": 1, }, "vulnerabilities": Object { "byOrg": Array [ diff --git a/backend/test/stats.test.ts b/backend/test/stats.test.ts index f73fdff6..5a5588f6 100644 --- a/backend/test/stats.test.ts +++ b/backend/test/stats.test.ts @@ -53,7 +53,7 @@ describe('stats', () => { await connection.close(); }); describe('get', () => { - it('get by org user should return only domains from that org', async () => { + it('get by orgs user should return only domains from those orgs', async () => { const organization = await Organization.create({ name: 'test-' + Math.random(), rootDomains: ['test-' + Math.random()], @@ -99,6 +99,11 @@ describe('stats', () => { ] }) ) + .send({ + filters: { + organizations: [organization.id] + } + }) .expect(200); expect(response.body.result).toMatchSnapshot(standard); expect(response.body.result.domains.numVulnerabilities[0].id).toEqual(