Make sure sidebar toggle is rendered only when the sidebar exists

This commit is contained in:
Alejandro Celaya
2025-08-13 10:06:45 +02:00
parent df3ee490a9
commit d762ae1e39
5 changed files with 29 additions and 22 deletions

View File

@@ -5,11 +5,16 @@ import type { NonReachableServer, NotFoundServer, SelectedServer } from '../../s
import { checkAccessibility } from '../__helpers__/accessibility';
import { MemoryRouterWithParams } from '../__helpers__/MemoryRouterWithParams';
vi.mock('@shlinkio/shlink-web-component', () => ({
ShlinkSidebarVisibilityProvider: ({ children }: any) => children,
ShlinkSidebarToggleButton: ({ children }: any) => children,
ShlinkWebComponent: () => <>ShlinkWebComponent</>,
}));
describe('<ShlinkWebComponentContainer />', () => {
const ShlinkWebComponentContainer = ShlinkWebComponentContainerFactory(fromPartial({
buildShlinkApiClient: vi.fn().mockReturnValue(fromPartial({})),
TagColorsStorage: fromPartial({}),
ShlinkWebComponent: () => <>ShlinkWebComponent</>,
ServerError: () => <>ServerError</>,
}));
const setUp = (selectedServer: SelectedServer) => render(