Skip to content

Commit

Permalink
[Tests] jsx-max-depth: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Mar 23, 2021
1 parent 525af5f commit 4dda913
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/lib/rules/jsx-max-depth.js
Expand Up @@ -267,5 +267,30 @@ ruleTester.run('jsx-max-depth', rule, {
data: {needed: 1, found: 2}
}
]
}, {
code: `
<div className="custom_modal">
<Modal className={classes.modal} open={isOpen} closeAfterTransition>
<Fade in={isOpen}>
<DialogContent>
<Icon icon="cancel" onClick={onClose} popoverText="Close Modal" />
<div className="modal_content">{children}</div>
<div className={clxs('modal_buttons', classes.buttons)}>
<Button className="modal_buttons--cancel" onClick={onCancel}>
{cancelMsg ? cancelMsg : 'Cancel'}
</Button>
</div>
</DialogContent>
</Fade>
</Modal>
</div>
`,
options: [{max: 4}],
errors: [
{
messageId: 'wrongDepth',
data: {needed: 4, found: 5}
}
]
}]
});

0 comments on commit 4dda913

Please sign in to comment.