Skip to content

Commit ec9a5d0

Browse files
committed
Add skipImportCheck test for no-system-props
1 parent 8041452 commit ec9a5d0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/rules/__tests__/no-system-props.test.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ruleTester.run('no-system-props', rule, {
2020
`import {ProgressBar} from '@primer/react'; <ProgressBar bg="howdy" />`,
2121
`import {Button} from '@primer/react'; <Button {...someExpression()} />`,
2222
`import {Button} from '@primer/react'; <Button variant="large" />`,
23-
`import {Button} from '@primer/react'; <Button size="large" />`,
23+
`import {Button} from '@primer/react'; <Button size="large" />`
2424
],
2525
invalid: [
2626
{
@@ -144,6 +144,28 @@ ruleTester.run('no-system-props', rule, {
144144
data: {propNames: 'width', componentName: 'Text'}
145145
}
146146
]
147+
},
148+
{
149+
code: `import {Button} from '../Button'; <Button width={200} />`,
150+
options: [{skipImportCheck: true}],
151+
output: `import {Button} from '../Button'; <Button sx={{width: 200}} />`,
152+
errors: [
153+
{
154+
messageId: 'noSystemProps',
155+
data: {propNames: 'width', componentName: 'Button'}
156+
}
157+
]
158+
},
159+
{
160+
code: `import {Foo} from '../Foo'; <Foo width={200} />`,
161+
options: [{skipImportCheck: true}],
162+
output: `import {Foo} from '../Foo'; <Foo sx={{width: 200}} />`,
163+
errors: [
164+
{
165+
messageId: 'noSystemProps',
166+
data: {propNames: 'width', componentName: 'Foo'}
167+
}
168+
]
147169
}
148170
]
149171
})

0 commit comments

Comments
 (0)