-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af57d4c
commit 783f816
Showing
3 changed files
with
220 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,181 @@ | ||
import React from 'react' | ||
import { | ||
Alert, | ||
AlertProps, | ||
AspectImage, | ||
AspectImageProps, | ||
AspectRatio, | ||
AspectRatioProps, | ||
Avatar, | ||
AvatarProps, | ||
Badge, | ||
BadgeProps, | ||
Box, | ||
BoxProps, | ||
Button, | ||
ButtonProps, | ||
Card, | ||
CardProps, | ||
Checkbox, | ||
CheckboxProps, | ||
Close, | ||
CloseProps, | ||
Container, | ||
ContainerProps, | ||
Divider, | ||
DividerProps, | ||
Donut, | ||
DonutProps, | ||
Embed, | ||
EmbedProps, | ||
Field, | ||
FieldProps, | ||
Flex, | ||
FlexProps, | ||
Grid, | ||
GridProps, | ||
Heading, | ||
HeadingProps, | ||
IconButton, | ||
IconButtonProps, | ||
Image, | ||
ImageProps, | ||
Input, | ||
InputProps, | ||
Label, | ||
LabelProps, | ||
Link, | ||
LinkProps, | ||
MenuButton, | ||
MenuButtonProps, | ||
Message, | ||
MessageProps, | ||
NavLink, | ||
NavLinkProps, | ||
Progress, | ||
ProgressProps, | ||
Radio, | ||
RadioProps, | ||
Select, | ||
SelectProps, | ||
Slider, | ||
SliderProps, | ||
Spinner, | ||
SpinnerProps, | ||
Text, | ||
TextProps, | ||
Textarea, | ||
TextareaProps, | ||
} from '../' | ||
|
||
/** | ||
* This isn't technically a Jest test, as Jest won't catch any type errors. | ||
* It makes more sense to put this under the test/ folder organizationally. | ||
* Wrap everything in describe/it so Jest won't complain, but this actually | ||
* gets run in a meaningul way with tsc as part of the typecheck command. | ||
*/ | ||
describe('components type check', () => { | ||
it('should pass type check for props', () => { | ||
// Alert | ||
;((props: AlertProps) => <Alert {...props} />)({}) | ||
|
||
// AspectImage | ||
;((props: AspectImageProps) => <AspectImage {...props} />)({}) | ||
|
||
// AspectRatio | ||
;((props: AspectRatioProps) => <AspectRatio {...props} />)({}) | ||
|
||
// Avatar | ||
;((props: AvatarProps) => <Avatar {...props} />)({}) | ||
|
||
// Badge | ||
;((props: BadgeProps) => <Badge {...props} />)({}) | ||
|
||
// Box | ||
;((props: BoxProps) => <Box {...props} />)({}) | ||
|
||
// Button | ||
;((props: ButtonProps) => <Button {...props} />)({}) | ||
|
||
// Card | ||
;((props: CardProps) => <Card {...props} />)({}) | ||
|
||
// Checkbox | ||
;((props: CheckboxProps) => <Checkbox {...props} />)({}) | ||
|
||
// Close | ||
;((props: CloseProps) => <Close {...props} />)({}) | ||
|
||
// Container | ||
;((props: ContainerProps) => <Container {...props} />)({}) | ||
|
||
// Divider | ||
;((props: DividerProps) => <Divider {...props} />)({}) | ||
|
||
// Donut | ||
;((props: DonutProps) => <Donut {...props} />)({ value: 50 }) | ||
|
||
// Embed | ||
;((props: EmbedProps) => <Embed {...props} />)({}) | ||
|
||
// Field | ||
;((props: FieldProps<typeof Input>) => <Field {...props} />)({ | ||
label: 'Email', | ||
name: 'email', | ||
}) | ||
|
||
// Flex | ||
;((props: FlexProps) => <Flex {...props} />)({}) | ||
|
||
// Grid | ||
;((props: GridProps) => <Grid {...props} />)({}) | ||
|
||
// Heading | ||
;((props: HeadingProps) => <Heading {...props} />)({}) | ||
|
||
// IconButton | ||
;((props: IconButtonProps) => <IconButton {...props} />)({}) | ||
|
||
// Image | ||
;((props: ImageProps) => <Image {...props} />)({}) | ||
|
||
// Input | ||
;((props: InputProps) => <Input {...props} />)({}) | ||
|
||
// Label | ||
;((props: LabelProps) => <Label {...props} />)({}) | ||
|
||
// Link | ||
;((props: LinkProps) => <Link {...props} />)({}) | ||
|
||
// MenuButton | ||
;((props: MenuButtonProps) => <MenuButton {...props} />)({}) | ||
|
||
// Message | ||
;((props: MessageProps) => <Message {...props} />)({}) | ||
|
||
// NavLink | ||
;((props: NavLinkProps) => <NavLink {...props} />)({}) | ||
|
||
// Progress | ||
;((props: ProgressProps) => <Progress {...props} />)({}) | ||
|
||
// Radio | ||
;((props: RadioProps) => <Radio {...props} />)({}) | ||
|
||
// Select | ||
;((props: SelectProps) => <Select {...props} />)({}) | ||
|
||
// Slider | ||
;((props: SliderProps) => <Slider {...props} />)({}) | ||
|
||
// Spinner | ||
;((props: SpinnerProps) => <Spinner {...props} />)({}) | ||
|
||
// Text | ||
;((props: TextProps) => <Text {...props} />)({}) | ||
|
||
// Textarea | ||
;((props: TextareaProps) => <Textarea {...props} />)({}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"include": ["src/**/*.ts", "src/**/*.tsx", "index.d.ts"] | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx", | ||
"test/**/*.ts", | ||
"test/**/*.tsx", | ||
"index.d.ts" | ||
] | ||
} |