From 74e1d46e18460f30457181e86f38d8494f43d07b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=AB=20Maas?= Date: Fri, 22 Nov 2024 16:39:08 +0100 Subject: [PATCH] fix: Fix broken tests --- .../__tests__/localAgent.test.ts | 2 +- .../__tests__/restAgent.test.ts | 2 +- .../shared/geolocationStoreAgentStoreLogic.ts | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/geolocation-store/__tests__/localAgent.test.ts b/packages/geolocation-store/__tests__/localAgent.test.ts index 66b1b35f..74b709bb 100644 --- a/packages/geolocation-store/__tests__/localAgent.test.ts +++ b/packages/geolocation-store/__tests__/localAgent.test.ts @@ -8,7 +8,7 @@ let dbConnection: Promise let agent: any const setup = async (): Promise => { - const config = await getConfig('packages/anomaly-detection-store/agent.yml') + const config = await getConfig('packages/geolocation-store/agent.yml') const { localAgent, db } = await createObjects(config, { localAgent: '/agent', db: '/dbConnection' }) agent = localAgent dbConnection = db diff --git a/packages/geolocation-store/__tests__/restAgent.test.ts b/packages/geolocation-store/__tests__/restAgent.test.ts index 8bc4a15c..671a1310 100644 --- a/packages/geolocation-store/__tests__/restAgent.test.ts +++ b/packages/geolocation-store/__tests__/restAgent.test.ts @@ -32,7 +32,7 @@ const getAgent = (options?: IAgentOptions) => }) const setup = async (): Promise => { - const config = await getConfig('packages/anomaly-detection-store/agent.yml') + const config = await getConfig('packages/geolocation-store/agent.yml') const { agent, db } = await createObjects(config, { agent: '/agent', db: '/dbConnection' }) serverAgent = agent dbConnection = db diff --git a/packages/geolocation-store/__tests__/shared/geolocationStoreAgentStoreLogic.ts b/packages/geolocation-store/__tests__/shared/geolocationStoreAgentStoreLogic.ts index f8af4ce3..9abe4516 100644 --- a/packages/geolocation-store/__tests__/shared/geolocationStoreAgentStoreLogic.ts +++ b/packages/geolocation-store/__tests__/shared/geolocationStoreAgentStoreLogic.ts @@ -21,13 +21,13 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro it('should persist location', async () => { await expect( - agent.anomalyDetectionStorePersistLocation({ + agent.geolocationStorePersistLocation({ ipOrHostname: ip, locationArgs: location }), ).resolves.toEqual({ value: location }) - await expect(agent.anomalyDetectionStoreHasLocation({ + await expect(agent.geolocationStoreHasLocation({ ipOrHostname: ip, storeId: '_default', namespace: 'anomaly-detection' @@ -35,7 +35,7 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro }) it('should have a location persisted', async () => { - await expect(agent.anomalyDetectionStoreGetLocation({ + await expect(agent.geolocationStoreGetLocation({ ipOrHostname: ip, storeId: '_default', namespace: 'anomaly-detection'} @@ -48,12 +48,12 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro continent: 'NA', country: 'US', } - await agent.anomalyDetectionStorePersistLocation({ + await agent.geolocationStorePersistLocation({ ipOrHostname: ipv6, locationArgs: ipv6Location }) - await expect(agent.anomalyDetectionStoreGetLocation({ + await expect(agent.geolocationStoreGetLocation({ storeId: '_default', namespace: 'anomaly-detection', ipOrHostname: ipv6 @@ -66,12 +66,12 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro continent: 'EU', country: 'DE', } - await agent.anomalyDetectionStorePersistLocation({ + await agent.geolocationStorePersistLocation({ ipOrHostname: hostname, locationArgs: hostnameLocation }) - await expect(agent.anomalyDetectionStoreRemoveLocation({ + await expect(agent.geolocationStoreRemoveLocation({ ipOrHostname: ip, storeId: '_default', namespace: 'anomaly-detection' @@ -79,11 +79,11 @@ export default (testContext: { getAgent: () => ConfiguredAgent; setup: () => Pro }) it('should remove all locations', async () => { - await expect(agent.anomalyDetectionStoreClearAllLocations()).resolves.toBeTruthy() + await expect(agent.geolocationStoreClearAllLocations()).resolves.toBeTruthy() }) it('should retrieve the default location store', async () => { - await expect(agent.anomalyDetectionStoreDefaultLocationStore()).resolves.toBeDefined() + await expect(agent.geolocationStoreDefaultLocationStore()).resolves.toBeDefined() }) }) }