Skip to content

Commit 34a70d9

Browse files
committed
feat(web-ongoing-operations): pnpm migration
ref: #DCE-73 Signed-off-by: Kylian Bainvel <[email protected]>
1 parent 76a3109 commit 34a70d9

File tree

14 files changed

+160
-192
lines changed

14 files changed

+160
-192
lines changed

packages/manager-tools/manager-pm/src/playbook/catalog/pnpm-catalog.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"packages/manager/apps/web-office",
33
"packages/manager/apps/zimbra",
44
"packages/manager/apps/pci-instances",
5-
"packages/manager/apps/web-hosting"
5+
"packages/manager/apps/web-hosting",
6+
"packages/manager/apps/web-ongoing-operations"
67
]

packages/manager-tools/manager-pm/src/playbook/catalog/yarn-catalog.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"packages/manager/apps/vrack-services",
7474
"packages/manager/apps/web",
7575
"packages/manager/apps/web-domains",
76-
"packages/manager/apps/web-ongoing-operations",
7776
"packages/manager/core/api",
7877
"packages/manager/core/application",
7978
"packages/manager/core/ovh-product-icons",
@@ -86,4 +85,4 @@
8685
"packages/manager-tools/manager-legacy-tools/*",
8786
"packages/manager-ui-kit",
8887
"packages/manager-wiki"
89-
]
88+
]

packages/manager/apps/web-ongoing-operations/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,34 @@
2121
"@ovh-ux/manager-config": "^8.6.8",
2222
"@ovh-ux/manager-core-api": "^0.19.1",
2323
"@ovh-ux/manager-core-utils": "^0.4.7",
24-
"@ovh-ux/manager-react-components": "^2.43.1",
24+
"@ovh-ux/manager-react-components": "2.43.1",
2525
"@ovh-ux/manager-react-core-application": "^0.12.13",
2626
"@ovh-ux/manager-react-shell-client": "^0.11.1",
2727
"@ovh-ux/request-tagger": "^0.5.7",
28-
"@ovhcloud/ods-components": "^18.6.2",
28+
"@ovhcloud/ods-components": "18.6.2",
2929
"@ovhcloud/ods-react": "^19.1.0",
30-
"@ovhcloud/ods-themes": "^19.1.0",
31-
"@tanstack/react-query": "^5.69.0",
30+
"@ovhcloud/ods-themes": "19.1.0",
31+
"@tanstack/react-query": "5.90.2",
3232
"axios": "^1.1.2",
3333
"clsx": "^1.2.1",
3434
"date-fns": "^3.6.0",
35-
"i18next": "^23.8.2",
36-
"i18next-http-backend": "^2.4.2",
35+
"i18next": "23.8.2",
36+
"i18next-http-backend": "2.4.3",
3737
"p-limit": "^5.0.0",
3838
"punycode": "2.3.1",
39-
"react": "^18.2.0",
40-
"react-dom": "^18.2.0",
41-
"react-hook-form": "^7.50.1",
42-
"react-i18next": "^14.0.5",
43-
"react-router-dom": "^6.3.0",
39+
"react": "18.2.0",
40+
"react-dom": "18.2.0",
41+
"react-hook-form": "7.51.2",
42+
"react-i18next": "14.1.0",
43+
"react-router-dom": "6.16.0",
4444
"tailwindcss": "^3.4.4",
4545
"zod": "^3.24.2"
4646
},
4747
"devDependencies": {
48+
"@ovh-ux/manager-static-analysis-kit": "*",
4849
"@ovh-ux/manager-tests-setup": "latest",
49-
"@ovh-ux/manager-vite-config": "^0.14.1",
50-
"@tanstack/react-query-devtools": "^5.81.2",
51-
"element-internals-polyfill": "^3.0.2"
50+
"@ovh-ux/manager-vite-config": "0.13.4",
51+
"@tanstack/react-query-devtools": "5.90.2"
5252
},
5353
"regions": [
5454
"EU",

packages/manager/apps/web-ongoing-operations/src/components/Dashboard/DashboardPage.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '@/setupTests';
22
import { vi } from 'vitest';
3-
import { render, waitFor } from '@testing-library/react';
3+
import { render, screen, waitFor } from '@testing-library/react';
44
import { useResourcesIcebergV6 } from '@ovh-ux/manager-react-components';
55
import React from 'react';
66
import { wrapper } from '@/utils/test.provider';
@@ -37,7 +37,7 @@ describe('Datagrid template', () => {
3737
data: serviceInfo,
3838
});
3939

40-
const { getByTestId } = render(
40+
render(
4141
<DashboardPage
4242
searchableColumnID={ParentEnum.DOMAIN}
4343
parent={ParentEnum.DOMAIN}
@@ -48,7 +48,7 @@ describe('Datagrid template', () => {
4848
);
4949

5050
await waitFor(() => {
51-
expect(getByTestId('datagrid')).toBeInTheDocument();
51+
expect(screen.getByTestId('datagrid')).toBeInTheDocument();
5252
});
5353
});
5454
});

packages/manager/apps/web-ongoing-operations/src/pages/dashboard/Dashboard.spec.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import '@/setupTests';
22
import React from 'react';
33
import { describe, it, vi } from 'vitest';
44
import '@testing-library/jest-dom';
5-
import { render, waitFor } from '@testing-library/react';
6-
import { BrowserRouter } from 'react-router-dom';
5+
import { render, screen } from '@testing-library/react';
76
import {
87
useAuthorizationIam,
98
useFeatureAvailability,
@@ -12,6 +11,7 @@ import DashboardPage from '@/pages/dashboard/Dashboard';
1211
import { useGetIAMResourceAllDom } from '@/hooks/iam/iam';
1312
import { allDomIamResource } from '@/__mocks__/allDom';
1413
import { allDomFeatureAvailibility } from '@/constants';
14+
import { wrapper } from '@/utils/test.provider';
1515

1616
vi.mock('@/hooks/iam/iam', () => ({
1717
useGetIAMResourceAllDom: vi.fn(),
@@ -31,16 +31,11 @@ describe('dashboard test', () => {
3131
data: { [allDomFeatureAvailibility]: true },
3232
});
3333

34-
const { getByText } = render(
35-
<BrowserRouter>
36-
<DashboardPage />
37-
</BrowserRouter>,
38-
);
34+
globalThis.HTMLElement.prototype.scrollIntoView = vi.fn();
35+
render(<DashboardPage />, { wrapper });
3936

40-
await waitFor(() => {
41-
const tab = getByText('domain_operations_dashboard_title');
42-
expect(tab).toBeDefined();
43-
expect(tab).not.toHaveAttribute('active');
44-
});
37+
const tab = screen.getByText('domain_operations_dashboard_title');
38+
expect(tab).toBeInTheDocument();
39+
expect(tab).not.toHaveAttribute('active');
4540
});
4641
});

packages/manager/apps/web-ongoing-operations/src/pages/dashboard/Dashboard.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,21 @@ export default function DashboardPage() {
114114
tabs={
115115
<Tabs defaultValue={ParentEnum.DOMAIN}>
116116
<TabList>
117-
{tabsList.map((tab: DashboardTabItemProps) => {
118-
if (tab.hide) return <></>;
119-
return (
120-
<NavLink
121-
key={`osds-tab-bar-item-${tab.name}`}
122-
to={tab.to}
123-
className="no-underline"
124-
>
125-
<Tab id={tab.name} role="tab" value={tab.name}>
126-
{tab.title}
127-
</Tab>
128-
</NavLink>
129-
);
130-
})}
117+
{tabsList
118+
.filter((tab: DashboardTabItemProps) => !tab.hide)
119+
.map((tab: DashboardTabItemProps) => {
120+
return (
121+
<NavLink
122+
key={`osds-tab-bar-item-${tab.name}`}
123+
to={tab.to}
124+
className="no-underline"
125+
>
126+
<Tab id={tab.name} role="tab" value={tab.name}>
127+
{tab.title}
128+
</Tab>
129+
</NavLink>
130+
);
131+
})}
131132
</TabList>
132133
</Tabs>
133134
}

packages/manager/apps/web-ongoing-operations/src/pages/dashboard/allDom/AllDom.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '@/setupTests';
22
import React from 'react';
33
import '@testing-library/jest-dom';
44
import { vi } from 'vitest';
5-
import { render, waitFor } from '@testing-library/react';
5+
import { render, screen, waitFor } from '@testing-library/react';
66
import {
77
useAuthorizationIam,
88
useFeatureAvailability,
@@ -62,10 +62,10 @@ describe('alldom datagrid', () => {
6262
data: { [allDomFeatureAvailibility]: true },
6363
});
6464

65-
const { getByTestId } = render(<AllDom />, { wrapper });
65+
render(<AllDom />, { wrapper });
6666
await waitFor(() => {
67-
expect(getByTestId('datagrid')).toBeInTheDocument();
68-
const allDomName = getByTestId('allDom-test');
67+
expect(screen.getByTestId('datagrid')).toBeInTheDocument();
68+
const allDomName = screen.getByTestId('allDom-test');
6969
expect(allDomName).toBeInTheDocument();
7070
expect(allDomName).toHaveAttribute(
7171
'href',

packages/manager/apps/web-ongoing-operations/src/pages/dashboard/dns/Dns.spec.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '@/setupTests';
22
import React from 'react';
33
import '@testing-library/jest-dom';
44
import { vi } from 'vitest';
5-
import { render, waitFor } from '@testing-library/react';
5+
import { render, screen, waitFor } from '@testing-library/react';
66
import { useResourcesIcebergV6 } from '@ovh-ux/manager-react-components';
77
import { dns } from '@/__mocks__/dns';
88
import Dns from '@/pages/dashboard/dns/Dns';
@@ -68,10 +68,10 @@ describe('Dns datagrid', () => {
6868
data: serviceInfo,
6969
});
7070

71-
const { getByTestId } = render(<Dns />, { wrapper });
71+
render(<Dns />, { wrapper });
7272
await waitFor(() => {
73-
expect(getByTestId('datagrid')).toBeInTheDocument();
74-
const dnsName = getByTestId('testpuwebdomain.us');
73+
expect(screen.getByTestId('datagrid')).toBeInTheDocument();
74+
const dnsName = screen.getByTestId('testpuwebdomain.us');
7575
expect(dnsName).toBeInTheDocument();
7676
expect(dnsName).toHaveAttribute(
7777
'href',
@@ -95,10 +95,10 @@ describe('Dns datagrid', () => {
9595
data: undefined,
9696
});
9797

98-
const { getByTestId } = render(<Dns />, { wrapper });
98+
render(<Dns />, { wrapper });
9999
await waitFor(() => {
100-
expect(getByTestId('datagrid')).toBeInTheDocument();
101-
const dnsName = getByTestId('testpuwebdomain.us');
100+
expect(screen.getByTestId('datagrid')).toBeInTheDocument();
101+
const dnsName = screen.getByTestId('testpuwebdomain.us');
102102
expect(dnsName).toBeInTheDocument();
103103
expect(dnsName).toHaveAttribute(
104104
'href',

packages/manager/apps/web-ongoing-operations/src/pages/dashboard/domain/Domain.spec.tsx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import '@testing-library/jest-dom';
44
import { vi } from 'vitest';
55
import { useResourcesIcebergV6 } from '@ovh-ux/manager-react-components';
6-
import { render, waitFor, screen } from '@testing-library/react';
6+
import { render, waitFor, screen, fireEvent } from '@testing-library/react';
77
import { domain } from '@/__mocks__/domain';
88
import Domain from '@/pages/dashboard/domain/Domain';
99
import { taskMeDomain } from '@/constants';
@@ -60,24 +60,19 @@ describe('Domain datagrid', () => {
6060
}),
6161
}));
6262

63-
const { getByTestId } = render(<Domain />, { wrapper });
64-
await waitFor(() => {
65-
expect(getByTestId('datagrid')).toBeInTheDocument();
63+
render(<Domain />, { wrapper });
6664

67-
const domainName = getByTestId('case-where-modal-cant-be-open.ovh');
68-
expect(domainName).toBeInTheDocument();
69-
expect(domainName).toHaveAttribute(
70-
'href',
71-
'https://ovh.test/#/web/domain/case-where-modal-cant-be-open.ovh/information',
72-
);
65+
expect(screen.getByTestId('datagrid')).toBeInTheDocument();
7366

74-
// We test the able or disabled ActionButton
75-
const buttons = screen.getAllByTestId('navigation-action-trigger-action');
76-
const disabledButton = buttons[0]; // The button comes from the mock, it's the mock's first element
77-
expect(disabledButton).toHaveAttribute('is-disabled', 'true');
67+
const domainName = screen.getByTestId('case-where-modal-cant-be-open.ovh');
68+
expect(domainName).toBeInTheDocument();
69+
expect(domainName).toHaveAttribute(
70+
'href',
71+
'https://ovh.test/#/web/domain/case-where-modal-cant-be-open.ovh/information',
72+
);
7873

79-
const ableButton = buttons[1]; // The button comes from the mock, it's the mock's second element
80-
expect(ableButton).toHaveAttribute('is-disabled', 'false');
81-
});
74+
const buttons = screen.getAllByTestId('navigation-action-trigger-action');
75+
expect(buttons[0]).toHaveAttribute('is-disabled', 'true');
76+
expect(buttons[1]).toBeEnabled();
8277
});
8378
});

packages/manager/apps/web-ongoing-operations/src/pages/tracking/Tracking.spec.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import '@testing-library/jest-dom';
44
import { useQuery } from '@tanstack/react-query';
55
import { vi } from 'vitest';
6-
import { render, waitFor } from '@testing-library/react';
6+
import { render, screen, waitFor } from '@testing-library/react';
77
import TrackingTranfert from '@/pages/tracking/Tracking';
88
import { wrapper } from '@/utils/test.provider';
99

@@ -33,10 +33,10 @@ describe('Tracking page', () => {
3333
it('display the tracking first step', async () => {
3434
(useQuery as jest.Mock).mockReturnValue({ data: trackingInit });
3535

36-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
36+
render(<TrackingTranfert />, { wrapper });
3737
await waitFor(() => {
38-
expect(getByTestId('init-spinner')).toBeInTheDocument();
39-
expect(getByTestId('init-section')).toBeInTheDocument();
38+
expect(screen.getByTestId('init-spinner')).toBeInTheDocument();
39+
expect(screen.getByTestId('init-section')).toBeInTheDocument();
4040
});
4141
});
4242

@@ -45,11 +45,11 @@ describe('Tracking page', () => {
4545
data: trackingContactConfirmation,
4646
});
4747

48-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
48+
render(<TrackingTranfert />, { wrapper });
4949
await waitFor(() => {
50-
expect(getByTestId('init-check')).toBeInTheDocument();
51-
expect(getByTestId('contact-spinner')).toBeInTheDocument();
52-
expect(getByTestId('contact-section')).toBeInTheDocument();
50+
expect(screen.getByTestId('init-check')).toBeInTheDocument();
51+
expect(screen.getByTestId('contact-spinner')).toBeInTheDocument();
52+
expect(screen.getByTestId('contact-section')).toBeInTheDocument();
5353
});
5454
});
5555

@@ -58,40 +58,40 @@ describe('Tracking page', () => {
5858
data: trackingCurrentRegistrarConfirmation,
5959
});
6060

61-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
61+
render(<TrackingTranfert />, { wrapper });
6262
await waitFor(() => {
63-
expect(getByTestId('contact-check')).toBeInTheDocument();
64-
expect(getByTestId('confirmation-spinner')).toBeInTheDocument();
65-
expect(getByTestId('confirmation-section')).toBeInTheDocument();
63+
expect(screen.getByTestId('contact-check')).toBeInTheDocument();
64+
expect(screen.getByTestId('confirmation-spinner')).toBeInTheDocument();
65+
expect(screen.getByTestId('confirmation-section')).toBeInTheDocument();
6666
});
6767
});
6868

6969
it('display the tracking last step', async () => {
7070
(useQuery as jest.Mock).mockReturnValue({ data: trackingFinalization });
7171

72-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
72+
render(<TrackingTranfert />, { wrapper });
7373
await waitFor(() => {
74-
expect(getByTestId('confirmation-check')).toBeInTheDocument();
75-
expect(getByTestId('finalization-spinner')).toBeInTheDocument();
76-
expect(getByTestId('finalization-section')).toBeInTheDocument();
74+
expect(screen.getByTestId('confirmation-check')).toBeInTheDocument();
75+
expect(screen.getByTestId('finalization-spinner')).toBeInTheDocument();
76+
expect(screen.getByTestId('finalization-section')).toBeInTheDocument();
7777
});
7878
});
7979

8080
it('display the tracking done', async () => {
8181
(useQuery as jest.Mock).mockReturnValue({ data: trackingDone });
8282

83-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
83+
render(<TrackingTranfert />, { wrapper });
8484
await waitFor(() => {
85-
expect(getByTestId('done')).toBeInTheDocument();
85+
expect(screen.getByTestId('done')).toBeInTheDocument();
8686
});
8787
});
8888

8989
it('display the tracking with error', async () => {
9090
(useQuery as jest.Mock).mockReturnValue({ data: trackingAuthError });
9191

92-
const { getByTestId } = render(<TrackingTranfert />, { wrapper });
92+
render(<TrackingTranfert />, { wrapper });
9393
await waitFor(() => {
94-
expect(getByTestId('auth-error')).toBeInTheDocument();
94+
expect(screen.getByTestId('auth-error')).toBeInTheDocument();
9595
});
9696
});
9797
});

0 commit comments

Comments
 (0)