test(types): test for tsx style validation
This commit is contained in:
parent
75fdcd85ce
commit
3f9906a2f8
@ -12,6 +12,15 @@ expectType<JSX.Element>(<div />)
|
||||
expectType<JSX.Element>(<div id="foo" />)
|
||||
expectType<JSX.Element>(<input value="foo" />)
|
||||
|
||||
// @ts-expect-error style css property validation
|
||||
expectError(<div style={{ unknown: 123 }} />)
|
||||
|
||||
// allow array styles and nested array styles
|
||||
expectType<JSX.Element>(<div style={[{ color: 'red' }]} />)
|
||||
expectType<JSX.Element>(
|
||||
<div style={[{ color: 'red' }, [{ fontSize: '1em' }]]} />
|
||||
)
|
||||
|
||||
// @ts-expect-error unknown prop
|
||||
expectError(<div foo="bar" />)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user