Expose container via provider

This commit is contained in:
Alejandro Celaya
2025-11-15 10:20:53 +01:00
parent 6094994cfa
commit f301513f5b
15 changed files with 92 additions and 53 deletions

View File

@@ -1,6 +1,7 @@
import { screen } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import { MemoryRouter } from 'react-router';
import { ContainerProvider } from '../../../src/container/context';
import type { NonReachableServer, NotFoundServer, SelectedServer } from '../../../src/servers/data';
import { ServerError } from '../../../src/servers/helpers/ServerError';
import { checkAccessibility } from '../../__helpers__/accessibility';
@@ -9,7 +10,9 @@ import { renderWithStore } from '../../__helpers__/setUpTest';
describe('<ServerError />', () => {
const setUp = (selectedServer: SelectedServer) => renderWithStore(
<MemoryRouter>
<ServerError />
<ContainerProvider value={fromPartial({ buildShlinkApiClient: vi.fn() })}>
<ServerError />
</ContainerProvider>
</MemoryRouter>,
{
initialState: { selectedServer, servers: {} },