-
-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dropdown): add type button in dropdown (#757)
* fix(dropdown): add type button in dropdown fix #756 * test(dropdown): add test of type button in dropdown component
- Loading branch information
1 parent
89d58dc
commit 974c126
Showing
2 changed files
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(<TestDropdown />); | ||
expect(button()).toHaveAttribute('type', 'button'); | ||
}); | ||
|
||
it('should be of type `button` with inline', async () => { | ||
render(<TestDropdown inline />); | ||
expect(button()).toHaveAttribute('type', 'button'); | ||
}); | ||
}); | ||
}); | ||
|
||
const TestDropdown: FC<{ dismissOnClick?: boolean }> = ({ dismissOnClick = true }) => ( | ||
<Dropdown label="Dropdown button" placement="right" dismissOnClick={dismissOnClick}> | ||
const TestDropdown: FC<{ dismissOnClick?: boolean; inline?: boolean }> = ({ | ||
dismissOnClick = true, | ||
inline = false, | ||
}) => ( | ||
<Dropdown label="Dropdown button" placement="right" dismissOnClick={dismissOnClick} inline={inline}> | ||
<Dropdown.Header> | ||
<span className="block text-sm">Bonnie Green</span> | ||
<span className="block truncate text-sm font-medium">[email protected]</span> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters