Skip to content

Commit

Permalink
chore: add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlux committed Sep 19, 2021
1 parent 394fa00 commit d05a2cf
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions tests/lib/rules/jsx-max-props-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ ruleTester.run('jsx-max-props-per-line', rule, {
'/>'
].join('\n'),
options: [{maximum: {multi: 2, single: 1}}]
}, {
code: '<App foo baz bar />',
options: [{maximum: {multi: 2, single: 3}}]
}, {
code: '<App {...this.props} bar />',
options: [{maximum: {single: 2}}]
}, {
code: [
'<App',
' foo bar',
' baz bor',
'/>'
].join('\n'),
options: [{maximum: {multi: 2, single: 1}}]
}
],

Expand Down Expand Up @@ -365,5 +379,47 @@ ruleTester.run('jsx-max-props-per-line', rule, {
messageId: 'newLine',
data: {prop: 'bor'}
}]
}, {
code: [
'<App',
' foo={{',
' }} bar baz bor',
'/>'
].join('\n'),
output: [
'<App',
' foo={{',
' }} bar',
'baz bor',
'/>'
].join('\n'),
options: [{maximum: {multi: 2}}],
errors: [{
messageId: 'newLine',
data: {prop: 'baz'}
}]
}, {
code: [
'<App boz fuz',
' foo={{',
' }} bar baz bor',
'/>'
].join('\n'),
output: [
'<App boz',
'fuz',
' foo={{',
' }} bar',
'baz bor',
'/>'
].join('\n'),
options: [{maximum: {multi: 2, single: 1}}],
errors: [{
messageId: 'newLine',
data: {prop: 'fuz'}
}, {
messageId: 'newLine',
data: {prop: 'baz'}
}]
}]
});

0 comments on commit d05a2cf

Please sign in to comment.