Skip to content

Commit 4bdd865

Browse files
committed
refactor(pci-project): fix tests build and linter
ref: #MANAGER-20320 Signed-off-by: Fabien Henon <[email protected]>
1 parent 880eb50 commit 4bdd865

File tree

55 files changed

+522
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+522
-517
lines changed

packages/manager/apps/pci-project/src/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ODS_ICON_NAME } from '@ovhcloud/ods-components';
22

33
import { OvhSubsidiary } from '@ovh-ux/manager-react-components';
44

5-
import { DashboardItem } from './data/types/Dashboard.type';
5+
import { DashboardItem } from './data/types/dashboard.type';
66

77
export const QUOTA_THRESHOLD = 80;
88

@@ -516,7 +516,7 @@ export const DASHBOARD_QUICK_ACCESS_ITEMS_BASE: DashboardItem[] = [
516516
{
517517
labelTranslationKey: 'pci_projects_home_database',
518518
descriptionTranslationKey: 'pci_projects_home_create_database',
519-
link: PCI_FEATURES_STATES.DATABASES.ADD.url,
519+
link: PCI_FEATURES_STATES.DATABASES!.ADD!.url,
520520
featureFlag: FEATURE_AVAILABILITY.DATABASES_ANALYTICS,
521521
trackingName: 'create_service_database',
522522
},

packages/manager/apps/pci-project/src/data/api/__tests__/Eligibility.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TEligibilityPaymentMethod,
99
TEligibilityRequiredAction,
1010
TEligibilityVoucher,
11-
} from '@/data/types/Eligibility.type';
11+
} from '@/data/types/eligibility.type';
1212

1313
import { checkVoucherEligibility, getEligibility } from '../eligibility';
1414

packages/manager/apps/pci-project/src/data/api/__tests__/ProjectsWithServices.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { getProjectsWithServices, projectsWithServiceQueryKey } from '../project
88
import { getServices } from '../services';
99

1010
// Mock the API functions
11-
vi.mock('./projects', () => ({
11+
vi.mock('../projects', () => ({
1212
getProjects: vi.fn(),
1313
getDefaultProject: vi.fn(),
1414
}));
1515

16-
vi.mock('./services', () => ({
16+
vi.mock('../services', () => ({
1717
getServices: vi.fn(),
1818
}));
1919

packages/manager/apps/pci-project/src/data/api/__tests__/Services.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { beforeEach, describe, expect, it, vi } from 'vitest';
1+
import { Mock, beforeEach, describe, expect, it, vi } from 'vitest';
22

33
import { v6 } from '@ovh-ux/manager-core-api';
44

@@ -10,9 +10,13 @@ type FetchResultV6<T> = {
1010
data: T[];
1111
};
1212

13-
vi.mock('@ovh-ux/manager-core-api');
13+
vi.mock('@ovh-ux/manager-core-api', () => ({
14+
v6: {
15+
get: vi.fn(),
16+
},
17+
}));
1418

15-
const mockedV6 = vi.mocked(v6.get.bind(v6));
19+
const mockedV6 = (v6 as unknown as { get: Mock }).get;
1620

1721
describe('services API', () => {
1822
beforeEach(() => {

packages/manager/apps/pci-project/src/data/api/credit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { v6 } from '@ovh-ux/manager-core-api';
22

3-
import { CreditDetailsResponse, TStartupProgram } from '@/data/types/Credit.type';
3+
import { CreditDetailsResponse, TStartupProgram } from '@/data/types/credit.type';
44

55
type FetchResultV6<T> = {
66
data: T[];

packages/manager/apps/pci-project/src/data/api/eligibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { v6 } from '@ovh-ux/manager-core-api';
22

3-
import { TEligibility, TEligibilityVoucher } from '@/data/types/Eligibility.type';
3+
import { TEligibility, TEligibilityVoucher } from '@/data/types/eligibility.type';
44

55
export const getEligibility = async (): Promise<TEligibility> => {
66
const { data } = await v6.get<TEligibility>(`/cloud/eligibility`);

packages/manager/apps/pci-project/src/data/api/projects-with-services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { TProjectWithService } from '@/data/types/Project.type';
21
import { TService } from '@/data/types/Service.type';
2+
import { TProjectWithService } from '@/data/types/project.type';
33
import { TProject } from '@/types/pci-common.types';
44

55
import { getDefaultProject, getProjects } from './projects';

packages/manager/apps/pci-project/src/data/api/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { v6 } from '@ovh-ux/manager-core-api';
33
import { DISCOVERY_PROJECT_ACTIVATION_PAYLOAD, FULL_PROJECT_PLAN_CODE } from '@/constants';
44
import { TCartServiceOption, TService, TServiceOption } from '@/data/types/Service.type';
55

6-
import { ProjectActivationResponse } from '../types/Project.type';
6+
import { ProjectActivationResponse } from '../types/project.type';
77

88
type FetchResultV6<T> = {
99
data: T[];

packages/manager/apps/pci-project/src/data/hooks/__tests__/UseActiveProjects.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { renderHook, waitFor } from '@testing-library/react';
22
import { beforeEach, describe, expect, it, vi } from 'vitest';
33

44
import * as projectsApi from '@/data/api/projects-with-services';
5-
import { TProjectWithService } from '@/data/types/Project.type';
5+
import { TProjectWithService } from '@/data/types/project.type';
66
import { createWrapper } from '@/wrapperRenders';
77

88
import useActiveProjects from '../useActiveProjects';

packages/manager/apps/pci-project/src/data/hooks/__tests__/UseCredit.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { renderHook, waitFor } from '@testing-library/react';
22
import { beforeEach, describe, expect, it, vi } from 'vitest';
33

44
import { getCreditBalance, getStartupProgram } from '@/data/api/credit';
5-
import { TStartupProgram } from '@/data/types/Credit.type';
5+
import { TStartupProgram } from '@/data/types/credit.type';
66
import { createWrapper } from '@/wrapperRenders';
77

88
import { useIsStartupProgramAvailable, useStartupProgramAmountText } from '../useCredit';

0 commit comments

Comments
 (0)