Skip to content

Commit 014e2bb

Browse files
chore(okms): fix all typescript errors
ref: #MANAGER-19870 Signed-off-by: Mathieu Mousnier <[email protected]>
1 parent 50df632 commit 014e2bb

File tree

129 files changed

+654
-482
lines changed

Some content is hidden

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

129 files changed

+654
-482
lines changed

packages/manager/apps/okms/src/common/components/okms-dashboard/billing-tile/BillingTile.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { KMS_ROUTES_URIS } from '@key-management-service/routes/routes.constants';
33
import { SECRET_MANAGER_ROUTES_URLS } from '@secret-manager/routes/routes.constants';
44
import { act, screen } from '@testing-library/react';
@@ -11,7 +11,7 @@ import { renderWithI18n } from '@/common/utils/tests/testUtils';
1111
import { BillingTile } from './BillingTile.component';
1212
import { BILLING_TILE_TEST_IDS } from './BillingTile.constants';
1313

14-
const okmsMocked = okmsMock[0];
14+
const okmsMocked = okmsRoubaix1Mock;
1515

1616
vi.mock('@/common/hooks/useProductType');
1717

packages/manager/apps/okms/src/common/components/okms-dashboard/general-informations-tile/GeneralInformationsTile.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33
import { vi } from 'vitest';
44

@@ -8,6 +8,8 @@ import { renderWithI18n } from '@/common/utils/tests/testUtils';
88
import { GeneralInformationsTile } from './GeneralInformationsTile.component';
99
import { GENERAL_INFORMATIONS_TILE_TEST_IDS } from './GeneralInformationsTile.constants';
1010

11+
const mockOkms = okmsRoubaix1Mock;
12+
1113
vi.mock('./items/NameTileItem.component', async (original) => ({
1214
...(await original()),
1315
NameTileItem: vi.fn(() => <div data-testid={GENERAL_INFORMATIONS_TILE_TEST_IDS.name} />),
@@ -39,7 +41,7 @@ describe('OKMS General Informations Tile test suite', () => {
3941
];
4042

4143
// WHEN
42-
await renderWithI18n(<GeneralInformationsTile okms={okmsMock[0]} />);
44+
await renderWithI18n(<GeneralInformationsTile okms={mockOkms} />);
4345

4446
// THEN
4547
expect(screen.getByText(labels.common.dashboard.general_information)).toBeVisible();

packages/manager/apps/okms/src/common/components/okms-dashboard/general-informations-tile/items/IdTileItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33

44
import { renderWithI18n } from '@/common/utils/tests/testUtils';
@@ -7,7 +7,7 @@ import { ID_LABEL } from '@/constants';
77

88
import { IdTileItem } from './IdTileItem.component';
99

10-
const okmsMocked = okmsMock[0];
10+
const okmsMocked = okmsRoubaix1Mock;
1111

1212
describe('OKMS ID Tile Item test suite', () => {
1313
it('should render the tile item correctly', async () => {

packages/manager/apps/okms/src/common/components/okms-dashboard/general-informations-tile/items/NameTileItem.spec.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { KMS_ROUTES_URLS } from '@key-management-service/routes/routes.constants';
33
import { SECRET_MANAGER_ROUTES_URLS } from '@secret-manager/routes/routes.constants';
44
import { act, screen } from '@testing-library/react';
@@ -12,7 +12,7 @@ import { getOdsButtonByIcon } from '@/common/utils/tests/uiTestHelpers';
1212

1313
import { NameTileItem } from './NameTileItem.component';
1414

15-
const okmsMocked = okmsMock[0];
15+
const okmsMocked = okmsRoubaix1Mock;
1616

1717
const mockNavigate = vi.fn();
1818
vi.mock('react-router-dom', async (importOriginal) => {
@@ -85,6 +85,7 @@ describe('OKMS Name Tile Item test suite', () => {
8585
await act(async () => {
8686
await user.click(editNameButton);
8787
});
88+
8889
expect(mockNavigate).toHaveBeenCalledWith(expectedLink);
8990
},
9091
);

packages/manager/apps/okms/src/common/components/okms-dashboard/general-informations-tile/items/RegionTileItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33

44
import { labels } from '@/common/utils/tests/init.i18n';
55
import { renderWithI18n } from '@/common/utils/tests/testUtils';
66

77
import { RegionTileItem } from './RegionTileItem.component';
88

9-
const okmsMocked = okmsMock[0];
9+
const okmsMocked = okmsRoubaix1Mock;
1010

1111
describe('OKMS region Tile Item test suite', () => {
1212
it('should render the tile item correctly', async () => {

packages/manager/apps/okms/src/common/components/okms-dashboard/general-informations-tile/items/UrnTileItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33

44
import { renderWithI18n } from '@/common/utils/tests/testUtils';
@@ -7,7 +7,7 @@ import { URN_LABEL } from '@/constants';
77

88
import { UrnTileItem } from './UrnTileItem.component';
99

10-
const okmsMocked = okmsMock[0];
10+
const okmsMocked = okmsRoubaix1Mock;
1111

1212
describe('OKMS Urn Tile Item test suite', () => {
1313
it('should render the tile item correctly', async () => {

packages/manager/apps/okms/src/common/components/okms-dashboard/kmip-objects-tile/KmipObjectsTile.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33
import { vi } from 'vitest';
44

@@ -8,6 +8,8 @@ import { renderWithI18n } from '@/common/utils/tests/testUtils';
88
import { KmipObjectsTile } from './KmipObjectsTile.component';
99
import { KMIP_OBJECTS_TILE_TEST_IDS } from './KmipObjectsTile.constants';
1010

11+
const okmsMocked = okmsRoubaix1Mock;
12+
1113
vi.mock('./items/KmipObjectCountTileItem.component', async (original) => ({
1214
...(await original()),
1315
KmipObjectCountTileItem: vi.fn(() => (
@@ -21,7 +23,7 @@ describe('OKMS Kmip Objects Tile test suite', () => {
2123
const tileItems = [KMIP_OBJECTS_TILE_TEST_IDS.kmipObjectCount];
2224

2325
// WHEN
24-
await renderWithI18n(<KmipObjectsTile okms={okmsMock[0]} />);
26+
await renderWithI18n(<KmipObjectsTile okms={okmsMocked} />);
2527

2628
// THEN
2729
expect(screen.getByText(labels.dashboard.kmip_objects)).toBeVisible();

packages/manager/apps/okms/src/common/components/okms-dashboard/kmip-objects-tile/items/KmipObjectCountTileItem.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33

44
import { labels } from '@/common/utils/tests/init.i18n';
55
import { renderWithI18n } from '@/common/utils/tests/testUtils';
66

77
import { KmipObjectCountTileItem } from './KmipObjectCountTileItem.component';
88

9-
const okmsMocked = okmsMock[0];
9+
const okmsMocked = okmsRoubaix1Mock;
1010

1111
describe('OKMS Kmip Object count Tile Item test suite', () => {
1212
it('should render the tile item correctly', async () => {

packages/manager/apps/okms/src/common/components/okms-dashboard/kmip-tile/KmipTile.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33
import { vi } from 'vitest';
44

@@ -8,6 +8,8 @@ import { KMIP_LABEL } from '@/constants';
88
import { KmipTile } from './KmipTile.component';
99
import { KMIP_TILE_TEST_IDS } from './KmipTile.constants';
1010

11+
const okmsMocked = okmsRoubaix1Mock;
12+
1113
vi.mock('./items/KmipEndpointTileItem.component', async (original) => ({
1214
...(await original()),
1315
KmipEndpointTileItem: vi.fn(() => <div data-testid={KMIP_TILE_TEST_IDS.kmipEndpoint} />),
@@ -24,7 +26,7 @@ describe('OKMS Kmip Tile test suite', () => {
2426
const tileItems = [KMIP_TILE_TEST_IDS.kmipEndpoint, KMIP_TILE_TEST_IDS.kmipEndpointRSA];
2527

2628
// WHEN
27-
await renderWithI18n(<KmipTile okms={okmsMock[0]} />);
29+
await renderWithI18n(<KmipTile okms={okmsMocked} />);
2830

2931
// THEN
3032
expect(screen.getByText(KMIP_LABEL)).toBeVisible();

packages/manager/apps/okms/src/common/components/okms-dashboard/kmip-tile/items/KmipEndpointRsaTileItem.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { okmsMock } from '@key-management-service/mocks/kms/okms.mock';
1+
import { okmsRoubaix1Mock } from '@key-management-service/mocks/kms/okms.mock';
22
import { screen } from '@testing-library/react';
33
import { vi } from 'vitest';
44

@@ -12,7 +12,7 @@ import { ENDPOINT_RSA_LABEL } from '@/constants';
1212

1313
import { KmipEndpointRsaTileItem } from './KmipEndpointRsaTileItem.component';
1414

15-
const okmsMocked = okmsMock[0];
15+
const okmsMocked = okmsRoubaix1Mock;
1616

1717
vi.mock(
1818
'@/common/components/download-okms-public-ca-link/DownloadOkmsPublicCaLink',
@@ -36,7 +36,7 @@ describe('OKMS Kmip endpoint RSA Tile Item test suite', () => {
3636

3737
expect(DownloadOkmsPublicCaLink).toHaveBeenCalledTimes(1);
3838
expect(
39-
vi.mocked(DownloadOkmsPublicCaLink).mock.calls[0][0],
39+
vi.mocked(DownloadOkmsPublicCaLink).mock.calls[0]?.[0],
4040
).toEqual<DownloadOkmsPublicCaLinkProps>({
4141
okms: okmsMocked,
4242
type: 'publicCaRsaKmip',

0 commit comments

Comments
 (0)