diff --git a/nym-api/tests/functional_test/status/status-gateway.test.ts b/nym-api/tests/functional_test/status/status-gateway.test.ts index 71f2becc6d..769d342fd4 100644 --- a/nym-api/tests/functional_test/status/status-gateway.test.ts +++ b/nym-api/tests/functional_test/status/status-gateway.test.ts @@ -56,20 +56,18 @@ describe("Get gateway data", (): void => { it("Get gateway average uptime", async (): Promise => { const identity_key = config.environmnetConfig.gateway_identity; const response = await status.getGatewayAverageUptime(identity_key); - if ("mix_id" in response) { + if ("identity" in response) { expect(identity_key).toStrictEqual(response.identity); - expect(typeof response.count).toBe("number"); + expect(typeof response.avg_uptime).toBe("number"); } else if ("message" in response) { - expect(response.message).toContain( - "could not find uptime history associated with mixnode" - ); + expect(response.message).toContain("gateway bond not found"); } }); it("Get a gateway status report", async (): Promise => { const identity_key = config.environmnetConfig.gateway_identity; const response = await status.getGatewayStatusReport(identity_key); - if ("mix_id" in response) { + if ("identity" in response) { expect(identity_key).toStrictEqual(response.identity); expect(typeof response.owner).toBe("string"); expect(typeof response.most_recent).toBe("number"); diff --git a/nym-api/tests/src/endpoints/Status.ts b/nym-api/tests/src/endpoints/Status.ts index afaa2d6abd..1f1617c305 100644 --- a/nym-api/tests/src/endpoints/Status.ts +++ b/nym-api/tests/src/endpoints/Status.ts @@ -4,6 +4,7 @@ import { CoreCount, DetailedGateway, DetailedMixnodes, + GatewayUptimeResponse, InclusionProbabilities, InclusionProbability, NodeHistory, @@ -67,7 +68,7 @@ export default class Status extends APIClient { public async getGatewayAverageUptime( identity_key: string - ): Promise { + ): Promise { const response = await this.restClient.sendGet({ route: `/gateway/${identity_key}/avg_uptime`, }); diff --git a/nym-api/tests/src/types/StatusInterfaces.ts b/nym-api/tests/src/types/StatusInterfaces.ts index b0ad1cf1b5..9c492721f0 100644 --- a/nym-api/tests/src/types/StatusInterfaces.ts +++ b/nym-api/tests/src/types/StatusInterfaces.ts @@ -168,6 +168,12 @@ export interface AvgUptime { node_performance: nodePerformance; } +export interface GatewayUptimeResponse { + identity: string; + avg_uptime: number; + node_performance: nodePerformance; +} + export interface DetailedGateway { gateway_bond: GatewayBond; performance: string;