Skip to content

Commit

Permalink
feat(pci.private-network): fix staletime for check status creation
Browse files Browse the repository at this point in the history
ref: -1826
Signed-off-by: tsiorifamonjena <[email protected]>
  • Loading branch information
Tsiorifamonjena committed Dec 13, 2024
1 parent e38fb9d commit 312ea5d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 107 deletions.
23 changes: 23 additions & 0 deletions packages/manager/apps/pci-private-network/src/__mocks__/catalog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const catalog = {
plans: [
{
code: 'planCode1',
regions: [
{
name: 'GRA11',
},
{ name: 'GRA7' },
],
},
{
code: 'planCode2',
regions: [
{
name: 'SGP1',
},
],
},
],
};

export { catalog };
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const fetchCheckPrivateNetworkCreationStatus = (
error.message as CreationStatus,
),
retryDelay: (attemptIndex) => Math.min(1000 * 2 ** attemptIndex, 30000),
staleTime: 0,
});

export const useSubnets = (
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
import { describe, vi } from 'vitest';
import { renderHook, waitFor } from '@testing-library/react';
import { catalog } from '@/__mocks__/catalog';
import useGatewayAvailabilityRegion from './useIsPlanCodeAvailableInRegion';

vi.mock('@ovh-ux/manager-pci-common', () => ({
useProject: vi.fn().mockReturnValue({ data: {} }),
useProductAvailability: vi.fn().mockReturnValue({
data: {
plans: [
{
code: 'planCode1',
regions: [
{
name: 'GRA11',
},
{ name: 'GRA7' },
],
},
{
code: 'planCode2',
regions: [
{
name: 'SGP1',
},
],
},
],
},
data: catalog,
}),
}));

Expand Down

This file was deleted.

0 comments on commit 312ea5d

Please sign in to comment.