diff --git a/src/components/PopoverDropdown/PopoverDropdown.tsx b/src/components/PopoverDropdown/PopoverDropdown.tsx index 9375d181..49ba3c17 100644 --- a/src/components/PopoverDropdown/PopoverDropdown.tsx +++ b/src/components/PopoverDropdown/PopoverDropdown.tsx @@ -25,13 +25,17 @@ const PopoverDropdown = ({ dropdownList, onClick, tooltipMessage }: TPopoverDrop return (
- setVisible(prevState => !prevState)} - tooltipContent={tooltipMessage} - > - - + {isAdvertiserBarred ? ( + + ) : ( + setVisible(prevState => !prevState)} + tooltipContent={tooltipMessage} + > + + + )} {visible && (
{dropdownList.map(item => ( diff --git a/src/components/PopoverDropdown/__tests__/PopoverDropdown.spec.tsx b/src/components/PopoverDropdown/__tests__/PopoverDropdown.spec.tsx index 181f51db..1c734176 100644 --- a/src/components/PopoverDropdown/__tests__/PopoverDropdown.spec.tsx +++ b/src/components/PopoverDropdown/__tests__/PopoverDropdown.spec.tsx @@ -48,10 +48,9 @@ describe('PopoverDropdown', () => { expect(mockProps.onClick).toHaveBeenCalledWith('value 1'); }); - it('should disable the button if advertiser is barred', async () => { + it('should disable the icon if advertiser is barred', async () => { mockUseIsAdvertiserBarred.mockReturnValue(true); render(); - await userEvent.click(screen.getByTestId('dt_popover_dropdown_icon')); - expect(screen.getByRole('button', { name: 'label 1' })).toBeDisabled(); + expect(screen.getByTestId('dt_popover_dropdown_icon')).not.toHaveProperty('onClick'); }); });