diff --git a/src/lib/components/Dropdown/Dropdown.spec.tsx b/src/lib/components/Dropdown/Dropdown.spec.tsx index 2b17dfa08..b22f2c571 100644 --- a/src/lib/components/Dropdown/Dropdown.spec.tsx +++ b/src/lib/components/Dropdown/Dropdown.spec.tsx @@ -55,10 +55,24 @@ describe('Components / Dropdown', () => { expect(dropdown()).not.toHaveClass('invisible'); }); }); + describe('Type of button', async () => { + it('should be of type `button`', async () => { + render(); + expect(button()).toHaveAttribute('type', 'button'); + }); + + it('should be of type `button` with inline', async () => { + render(); + expect(button()).toHaveAttribute('type', 'button'); + }); + }); }); -const TestDropdown: FC<{ dismissOnClick?: boolean }> = ({ dismissOnClick = true }) => ( - +const TestDropdown: FC<{ dismissOnClick?: boolean; inline?: boolean }> = ({ + dismissOnClick = true, + inline = false, +}) => ( + Bonnie Green name@flowbite.com diff --git a/src/lib/components/Dropdown/Dropdown.tsx b/src/lib/components/Dropdown/Dropdown.tsx index 2f759177c..8abd97709 100644 --- a/src/lib/components/Dropdown/Dropdown.tsx +++ b/src/lib/components/Dropdown/Dropdown.tsx @@ -119,11 +119,11 @@ const DropdownComponent: FC = ({ }, [ref]); return inline ? ( - ) : ( - );