Skip to content

Commit

Permalink
[test] Type-test event handlers on ListItem (#21298)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon authored Jun 3, 2020
1 parent d9c882c commit 1596790
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/material-ui/src/ListItem/ListItem.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ function BooleanButtonTest() {
return <ListItem>Editable? No</ListItem>;
}
}

// verify that https://github.com/mui-org/material-ui/issues/19756 already worked.
function MouseEnterTest() {
function handleMouseEnter(event: React.MouseEvent<HTMLLIElement>) {}
<ListItem onMouseEnter={handleMouseEnter} />;

function handleMouseEnterButton(event: React.MouseEvent<HTMLDivElement>) {}
// $ExpectError
<ListItem onMouseEnter={handleMouseEnterButton} />; // desired: missing property button
<ListItem button onMouseEnter={handleMouseEnterButton} />;
}

0 comments on commit 1596790

Please sign in to comment.