Skip to content

Commit

Permalink
update cypress interceptors
Browse files Browse the repository at this point in the history
  • Loading branch information
bnussman committed Feb 6, 2024
1 parent 98f9ffc commit e9b5c2a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file Integration tests for Akamai Cloud Load Balancer summary page.
*/

import { loadbalancerFactory, configurationFactory } from '@src/factories/aglb';
import { loadbalancerFactory, configurationFactory } from '@src/factories/aclb';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
Expand Down
50 changes: 25 additions & 25 deletions packages/manager/cypress/support/intercepts/load-balancers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
export const mockGetLoadBalancer = (loadBalancer: Loadbalancer) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancer.id}`),
apiMatcher(`/aclb/${loadBalancer.id}`),
makeResponse(loadBalancer)
);
};
Expand All @@ -37,7 +37,7 @@ export const mockGetLoadBalancer = (loadBalancer: Loadbalancer) => {
export const mockGetLoadBalancers = (loadBalancers: Loadbalancer[]) => {
return cy.intercept(
'GET',
apiMatcher('/aglb*'),
apiMatcher('/aclb*'),
paginateResponse(loadBalancers)
);
};
Expand All @@ -50,7 +50,7 @@ export const mockGetLoadBalancers = (loadBalancers: Loadbalancer[]) => {
* @returns Cypress chainable.
*/
export const mockDeleteLoadBalancer = (loadBalancerId: number) => {
return cy.intercept('DELETE', apiMatcher(`/aglb/${loadBalancerId}`), {});
return cy.intercept('DELETE', apiMatcher(`/aclb/${loadBalancerId}`), {});
};

/**
Expand All @@ -68,7 +68,7 @@ export const mockDeleteLoadBalancerError = (
const defaultMessage = 'An error occurred while deleting Load Balancer.';
return cy.intercept(
'DELETE',
apiMatcher(`/aglb/${loadBalancerId}`),
apiMatcher(`/aclb/${loadBalancerId}`),
makeErrorResponse(message ?? defaultMessage, 500)
);
};
Expand All @@ -87,7 +87,7 @@ export const mockGetLoadBalancerConfigurations = (
) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancerId}/configurations*`),
apiMatcher(`/aclb/${loadBalancerId}/configurations*`),
paginateResponse(configurations)
);
};
Expand All @@ -106,7 +106,7 @@ export const mockDeleteLoadBalancerConfiguration = (
) => {
return cy.intercept(
'DELETE',
apiMatcher(`/aglb/${loadBalancerId}/configurations/${configId}`),
apiMatcher(`/aclb/${loadBalancerId}/configurations/${configId}`),
{}
);
};
Expand All @@ -126,7 +126,7 @@ export const mockDeleteLoadBalancerConfigurationError = (
) => {
return cy.intercept(
'DELETE',
apiMatcher(`/aglb/${loadBalancerId}/configurations/${configId}`),
apiMatcher(`/aclb/${loadBalancerId}/configurations/${configId}`),
makeResponse({ errors: [{ reason: error }] }, 500)
);
};
Expand All @@ -145,7 +145,7 @@ export const mockCreateLoadBalancerConfiguration = (
) => {
return cy.intercept(
'POST',
apiMatcher(`/aglb/${loadBalancerId}/configurations`),
apiMatcher(`/aclb/${loadBalancerId}/configurations`),
makeResponse(configuration)
);
};
Expand All @@ -164,7 +164,7 @@ export const mockUpdateLoadBalancerConfiguration = (
) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancerId}/configurations/${configuration.id}`),
apiMatcher(`/aclb/${loadBalancerId}/configurations/${configuration.id}`),
makeResponse(configuration)
);
};
Expand All @@ -184,7 +184,7 @@ export const mockUpdateLoadBalancerConfigurationError = (
) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancerId}/configurations/${configurationId}`),
apiMatcher(`/aclb/${loadBalancerId}/configurations/${configurationId}`),
makeResponse({ errors }, 400)
);
};
Expand All @@ -203,7 +203,7 @@ export const mockCreateLoadBalancerConfigurationError = (
) => {
return cy.intercept(
'POST',
apiMatcher(`/aglb/${loadBalancerId}/configurations`),
apiMatcher(`/aclb/${loadBalancerId}/configurations`),
makeResponse({ errors }, 500)
);
};
Expand All @@ -222,7 +222,7 @@ export const mockGetLoadBalancerCertificates = (
) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancerId}/certificates*`),
apiMatcher(`/aclb/${loadBalancerId}/certificates*`),
paginateResponse(certificates)
);
};
Expand All @@ -240,7 +240,7 @@ export const mockUploadLoadBalancerCertificate = (
) => {
return cy.intercept(
'POST',
apiMatcher(`/aglb/${loadBalancerId}/certificates`),
apiMatcher(`/aclb/${loadBalancerId}/certificates`),
makeResponse(certificate)
);
};
Expand All @@ -259,7 +259,7 @@ export const mockDeleteLoadBalancerCertificate = (
) => {
return cy.intercept(
'DELETE',
apiMatcher(`/aglb/${loadBalancerId}/certificates/${certificateId}`),
apiMatcher(`/aclb/${loadBalancerId}/certificates/${certificateId}`),
makeResponse()
);
};
Expand All @@ -282,7 +282,7 @@ export const mockDeleteLoadBalancerCertificateError = (
'An error occurred while deleting Load Balancer certificate.';
return cy.intercept(
'DELETE',
apiMatcher(`/aglb/${loadBalancerId}/certificates/${certificateId}`),
apiMatcher(`/aclb/${loadBalancerId}/certificates/${certificateId}`),
makeErrorResponse(message ?? defaultMessage, 500)
);
};
Expand All @@ -300,7 +300,7 @@ export const mockUpdateLoadBalancerCertificate = (
) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancerId}/certificates/${certificate.id}`),
apiMatcher(`/aclb/${loadBalancerId}/certificates/${certificate.id}`),
makeResponse(certificate)
);
};
Expand All @@ -319,7 +319,7 @@ export const mockGetServiceTargets = (
) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancer.id}/service-targets*`),
apiMatcher(`/aclb/${loadBalancer.id}/service-targets*`),
paginateResponse(serviceTargets)
);
};
Expand All @@ -335,7 +335,7 @@ export const mockGetServiceTargetsError = (message?: string) => {
const defaultMessage = 'An error occurred while retrieving service targets';
return cy.intercept(
'GET',
apiMatcher('/aglb/service-targets*'),
apiMatcher('/aclb/service-targets*'),
makeErrorResponse(message ?? defaultMessage, 500)
);
};
Expand All @@ -354,7 +354,7 @@ export const mockCreateServiceTarget = (
) => {
return cy.intercept(
'POST',
apiMatcher(`/aglb/${loadBalancer.id}/service-targets`),
apiMatcher(`/aclb/${loadBalancer.id}/service-targets`),
makeResponse(serviceTarget)
);
};
Expand All @@ -373,7 +373,7 @@ export const mockUpdateServiceTarget = (
) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancer.id}/service-targets/${serviceTarget.id}`),
apiMatcher(`/aclb/${loadBalancer.id}/service-targets/${serviceTarget.id}`),
makeResponse(serviceTarget)
);
};
Expand All @@ -389,7 +389,7 @@ export const mockUpdateServiceTarget = (
export const mockCreateRoute = (loadBalancer: Loadbalancer, route: Route) => {
return cy.intercept(
'POST',
apiMatcher(`/aglb/${loadBalancer.id}/routes`),
apiMatcher(`/aclb/${loadBalancer.id}/routes`),
makeResponse(route)
);
};
Expand All @@ -408,7 +408,7 @@ export const mockGetLoadBalancerRoutes = (
) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancerId}/routes*`),
apiMatcher(`/aclb/${loadBalancerId}/routes*`),
paginateResponse(routes)
);
};
Expand All @@ -427,7 +427,7 @@ export const mockGetLoadBalancerServiceTargets = (
) => {
return cy.intercept(
'GET',
apiMatcher(`/aglb/${loadBalancerId}/service-targets*`),
apiMatcher(`/aclb/${loadBalancerId}/service-targets*`),
paginateResponse(serviceTargets)
);
};
Expand All @@ -443,7 +443,7 @@ export const mockGetLoadBalancerServiceTargets = (
export const mockUpdateRoute = (loadBalancer: Loadbalancer, route: Route) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancer.id}/routes/${route.id}`),
apiMatcher(`/aclb/${loadBalancer.id}/routes/${route.id}`),
makeResponse(route)
);
};
Expand All @@ -462,7 +462,7 @@ export const mockUpdateRouteError = (
) => {
return cy.intercept(
'PUT',
apiMatcher(`/aglb/${loadBalancer.id}/routes/${route.id}`),
apiMatcher(`/aclb/${loadBalancer.id}/routes/${route.id}`),
makeResponse(
{
errors: [
Expand Down

0 comments on commit e9b5c2a

Please sign in to comment.