Skip to content

Commit

Permalink
Modify redundant test, add additional CardHeader component prop tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rart committed Mar 20, 2020
1 parent c21f7f5 commit 30c75b8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/material-ui/src/CardHeader/CardHeader.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ function createElementBasePropMixedTest() {
React.createElement<CardHeaderProps<DefaultComponent, ComponentProp>>(CardHeader, {
component: 'div',
});
// ExpectError: type system should be demanding the required props of "CustomComponent"
React.createElement<CardHeaderProps<DefaultComponent, ComponentProp>>(CardHeader, {
component: CustomComponent,
});
// $ExpectError
React.createElement<CardHeaderProps<DefaultComponent, ComponentProp>>(CardHeader, {
// This test shouldn't fail but does; stringProp & numberProp are required props of CustomComponent
component: CustomComponent,
stringProp: '',
numberProp: 0,
});
React.createElement<CardHeaderProps>(CardHeader, {
disableTypography: true,
});
Expand All @@ -27,7 +38,7 @@ function createElementBasePropMixedTest() {
});
// $ExpectError
React.createElement<CardHeaderProps>(CardHeader, {
disableTypography: 'hello',
disableTypography: 1,
});
// $ExpectError
React.createElement<CardHeaderProps<any, ComponentProp>>(CardHeader, {
Expand Down

0 comments on commit 30c75b8

Please sign in to comment.