Explicitly wrap in ContainerProvider when calling renderWithStore

This commit is contained in:
Alejandro Celaya
2025-11-24 09:11:06 +01:00
parent 514162964d
commit d11358af59
12 changed files with 43 additions and 65 deletions

View File

@@ -1,7 +1,6 @@
import { screen, waitFor } from '@testing-library/react';
import { fromPartial } from '@total-typescript/shoehorn';
import { MemoryRouter } from 'react-router';
import { ContainerProvider } from '../../src/container/context';
import type { ServersMap, ServerWithId } from '../../src/servers/data';
import { ManageServers } from '../../src/servers/ManageServers';
import type { ServersExporter } from '../../src/servers/services/ServersExporter';
@@ -17,14 +16,7 @@ describe('<ManageServers />', () => {
);
const setUp = (servers: ServersMap = {}) => renderWithStore(
<MemoryRouter>
<ContainerProvider value={fromPartial({
ServersExporter: serversExporter,
ImportServersBtn: () => <span>ImportServersBtn</span>,
useTimeoutToggle,
buildShlinkApiClient: vi.fn(),
})}>
<ManageServers />
</ContainerProvider>
<ManageServers useTimeoutToggle={useTimeoutToggle} ServersExporter={serversExporter} />
</MemoryRouter>,
{
initialState: { servers },