From b2044ff8b5d5e223f5dd1bf5b06d6f4d4b67c168 Mon Sep 17 00:00:00 2001 From: Banks Nussman Date: Tue, 6 Feb 2024 13:46:45 -0500 Subject: [PATCH] update unit test api endpoint mock urls --- packages/manager/src/factories/aclb.ts | 15 ++++++++------- .../ConfigurationAccordionHeader.test.tsx | 2 +- .../ConfigurationEndpointHealth.test.tsx | 2 +- .../LoadBalancerEndpointHealth.test.tsx | 2 +- .../ServiceTargetEndpointHealth.test.tsx | 2 +- .../LoadBalancerLanding/Ports.test.tsx | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/manager/src/factories/aclb.ts b/packages/manager/src/factories/aclb.ts index cd5f2b9bc55..7a3779e4ebc 100644 --- a/packages/manager/src/factories/aclb.ts +++ b/packages/manager/src/factories/aclb.ts @@ -1,4 +1,8 @@ -import { +import * as Factory from 'factory.ts'; + +import { pickRandom } from 'src/utilities/random'; + +import type { Certificate, Configuration, ConfigurationsEndpointHealth, @@ -14,10 +18,7 @@ import { ServiceTargetPayload, ServiceTargetsEndpointHealth, UpdateLoadbalancerPayload, -} from '@linode/api-v4/lib/aglb/types'; -import * as Factory from 'factory.ts'; - -import { pickRandom } from 'src/utilities/random'; +} from '@linode/api-v4'; export const mockCertificate = ` -----BEGIN CERTIFICATE----- @@ -101,9 +102,9 @@ export const configurationFactory = Factory.Sync.makeFactory({ // *********************** export const loadbalancerFactory = Factory.Sync.makeFactory({ configurations: [{ id: 1, label: 'my-config-1' }], - hostname: 'loadbalancer1.aglb.akamai.com', + hostname: 'loadbalancer1.aclb.akamai.com', id: Factory.each((i) => i), - label: Factory.each((i) => `aglb-${i}`), + label: Factory.each((i) => `aclb-${i}`), regions: ['us-west'], tags: ['tag1', 'tag2'], }); diff --git a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationAccordionHeader.test.tsx b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationAccordionHeader.test.tsx index e62799f2ff7..c2ada09d05c 100644 --- a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationAccordionHeader.test.tsx +++ b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationAccordionHeader.test.tsx @@ -54,7 +54,7 @@ describe('ConfigurationAccordionHeader', () => { server.use( rest.get( - '*/v4beta/aglb/5/configurations/endpoints-health', + '*/v4beta/aclb/5/configurations/endpoints-health', (req, res, ctx) => res(ctx.json(allConfigurationsEndpointHealth)) ) ); diff --git a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationEndpointHealth.test.tsx b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationEndpointHealth.test.tsx index 51c545fe67a..540cd2d5d01 100644 --- a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationEndpointHealth.test.tsx +++ b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationEndpointHealth.test.tsx @@ -13,7 +13,7 @@ describe('ConfigurationEndpointHealth', () => { it('renders endpoint health from API data', async () => { server.use( rest.get( - '*/v4beta/aglb/:id/configurations/endpoints-health', + '*/v4beta/aclb/:id/configurations/endpoints-health', (req, res, ctx) => { const health = configurationsEndpointHealthFactory.build({ configurations: [ diff --git a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/LoadBalancerEndpointHealth.test.tsx b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/LoadBalancerEndpointHealth.test.tsx index cf8fc0791e6..b327ce2a420 100644 --- a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/LoadBalancerEndpointHealth.test.tsx +++ b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/LoadBalancerEndpointHealth.test.tsx @@ -9,7 +9,7 @@ import { LoadBalancerEndpointHealth } from './LoadBalancerEndpointHealth'; describe('LoadBalancerEndpointHealth', () => { it('renders endpoint health from API data', async () => { server.use( - rest.get('*/v4beta/aglb/:id/endpoints-health', (req, res, ctx) => { + rest.get('*/v4beta/aclb/:id/endpoints-health', (req, res, ctx) => { const health = loadbalancerEndpointHealthFactory.build({ healthy_endpoints: 150, total_endpoints: 200, diff --git a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/ServiceTargets/ServiceTargetEndpointHealth.test.tsx b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/ServiceTargets/ServiceTargetEndpointHealth.test.tsx index b03820c63c9..1e662aec7dd 100644 --- a/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/ServiceTargets/ServiceTargetEndpointHealth.test.tsx +++ b/packages/manager/src/features/LoadBalancers/LoadBalancerDetail/ServiceTargets/ServiceTargetEndpointHealth.test.tsx @@ -15,7 +15,7 @@ describe('ServiceTargetEndpontHeath', () => { server.use( rest.get( - '*/v4beta/aglb/:id/service-targets/endpoints-health', + '*/v4beta/aclb/:id/service-targets/endpoints-health', (req, res, ctx) => { const health = serviceTargetsEndpointHealthFactory.build({ service_targets: [ diff --git a/packages/manager/src/features/LoadBalancers/LoadBalancerLanding/Ports.test.tsx b/packages/manager/src/features/LoadBalancers/LoadBalancerLanding/Ports.test.tsx index 7c8652be106..4af576fb1ef 100644 --- a/packages/manager/src/features/LoadBalancers/LoadBalancerLanding/Ports.test.tsx +++ b/packages/manager/src/features/LoadBalancers/LoadBalancerLanding/Ports.test.tsx @@ -17,7 +17,7 @@ describe('Ports', () => { ]; server.use( - rest.get('*/aglb/1/configurations*', (req, res, ctx) => { + rest.get('*/aclb/1/configurations*', (req, res, ctx) => { return res(ctx.json(makeResourcePage(configs))); }) );