diff --git a/packages/components/src/PageHeader/ButtonGroup/ButtonGroupSecondaryVisibleActions/ButtonGroupSecondaryVisibleActions.tsx b/packages/components/src/PageHeader/ButtonGroup/ButtonGroupSecondaryVisibleActions/ButtonGroupSecondaryVisibleActions.tsx index dfd88f4f8..53cbeb94e 100644 --- a/packages/components/src/PageHeader/ButtonGroup/ButtonGroupSecondaryVisibleActions/ButtonGroupSecondaryVisibleActions.tsx +++ b/packages/components/src/PageHeader/ButtonGroup/ButtonGroupSecondaryVisibleActions/ButtonGroupSecondaryVisibleActions.tsx @@ -22,8 +22,7 @@ export const ButtonGroupSecondaryVisibleActions = ({ actions, }: ButtonGroupMainActionProps) => { return actions.map((action) => { - const { name, icon, disableReason, disabled, onClick, ...mainProps } = - action; + const { name, icon, disableReason, disabled, ...mainProps } = action; return ( { expect(tooltip).toBeVisible(); expect(tooltip).toHaveTextContent('Отправка по маршруту'); }); + + it('OnClick вызывается при нажатии на вторичные видимые действия', async () => { + const onClickSpy = vi.fn(); + + renderWithTheme( + , + onClick: onClickSpy, + }, + ], + }} + />, + ); + + const button = screen.getByRole('button'); + + await userEvents.click(button); + expect(onClickSpy).toBeCalled(); + }); });