Skip to content

Commit 4dda913

Browse files
committed
[Tests] jsx-max-depth: add test case
See #2880 (comment)
1 parent 525af5f commit 4dda913

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/lib/rules/jsx-max-depth.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,5 +267,30 @@ ruleTester.run('jsx-max-depth', rule, {
267267
data: {needed: 1, found: 2}
268268
}
269269
]
270+
}, {
271+
code: `
272+
<div className="custom_modal">
273+
<Modal className={classes.modal} open={isOpen} closeAfterTransition>
274+
<Fade in={isOpen}>
275+
<DialogContent>
276+
<Icon icon="cancel" onClick={onClose} popoverText="Close Modal" />
277+
<div className="modal_content">{children}</div>
278+
<div className={clxs('modal_buttons', classes.buttons)}>
279+
<Button className="modal_buttons--cancel" onClick={onCancel}>
280+
{cancelMsg ? cancelMsg : 'Cancel'}
281+
</Button>
282+
</div>
283+
</DialogContent>
284+
</Fade>
285+
</Modal>
286+
</div>
287+
`,
288+
options: [{max: 4}],
289+
errors: [
290+
{
291+
messageId: 'wrongDepth',
292+
data: {needed: 4, found: 5}
293+
}
294+
]
270295
}]
271296
});

0 commit comments

Comments
 (0)