Skip to content

Commit c9b60a6

Browse files
mdjermanovicljharb
authored andcommitted
[Tests] remove duplicate tests
1 parent a762b25 commit c9b60a6

13 files changed

+1
-180
lines changed

tests/lib/rules/destructuring-assignment.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,6 @@ ruleTester.run('destructuring-assignment', rule, {
374374
code: `
375375
import { useContext } from 'react';
376376
377-
const MyComponent = (props) => {
378-
const {foo} = useContext(aContext);
379-
return <div>{foo}</div>
380-
};
381-
`,
382-
options: ['always'],
383-
settings: { react: { version: '16.9.0' } },
384-
},
385-
{
386-
code: `
387-
import { useContext } from 'react';
388-
389377
const MyComponent = (props) => {
390378
const foo = useContext(aContext);
391379
return <div>{foo.test}</div>

tests/lib/rules/display-name.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -369,39 +369,6 @@ ruleTester.run('display-name', rule, {
369369
};
370370
`,
371371
},
372-
{
373-
code: `
374-
import React, {createElement} from "react";
375-
const SomeComponent = (props) => {
376-
const {foo, bar} = props;
377-
return someComponentFactory({
378-
onClick: () => foo(bar("x"))
379-
});
380-
};
381-
`,
382-
},
383-
{
384-
code: `
385-
import React, {Component} from "react";
386-
function someDecorator(ComposedComponent) {
387-
return class MyDecorator extends Component {
388-
render() {return <ComposedComponent {...this.props} />;}
389-
};
390-
}
391-
module.exports = someDecorator;
392-
`,
393-
},
394-
{
395-
code: `
396-
import React, {Component} from "react";
397-
function someDecorator(ComposedComponent) {
398-
return class MyDecorator extends Component {
399-
render() {return <ComposedComponent {...this.props} />;}
400-
};
401-
}
402-
module.exports = someDecorator;
403-
`,
404-
},
405372
{
406373
code: `
407374
const element = (

tests/lib/rules/forbid-component-props.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,6 @@ ruleTester.run('forbid-component-props', rule, {
166166
},
167167
],
168168
},
169-
{
170-
code: `
171-
const item = (<Foo className="foo" />);
172-
`,
173-
options: [
174-
{
175-
forbid: [
176-
{
177-
propName: 'className',
178-
disallowedFor: ['ReactModal'],
179-
},
180-
],
181-
},
182-
],
183-
},
184169
{
185170
code: `
186171
<fbt:param name="Total number of files" number={true} />

tests/lib/rules/jsx-curly-brace-presence.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -657,12 +657,6 @@ ruleTester.run('jsx-curly-brace-presence', rule, {
657657
options: [{ props: 'always' }],
658658
errors: [{ messageId: 'missingCurly' }],
659659
},
660-
{
661-
code: `<MyComponent prop="foo 'bar'">foo</MyComponent>`,
662-
output: `<MyComponent prop={"foo 'bar'"}>foo</MyComponent>`,
663-
options: [{ props: 'always' }],
664-
errors: [{ messageId: 'missingCurly' }],
665-
},
666660
{
667661
code: '<MyComponent>foo bar </MyComponent>',
668662
output: `<MyComponent>{"foo bar "}</MyComponent>`,

tests/lib/rules/jsx-curly-spacing.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -756,14 +756,6 @@ ruleTester.run('jsx-curly-spacing', rule, {
756756
`,
757757
options: ['always'],
758758
},
759-
{
760-
code: `
761-
<App {
762-
...bar
763-
} />;
764-
`,
765-
options: ['always'],
766-
},
767759
{
768760
code: `
769761
<App {

tests/lib/rules/jsx-handler-names.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ ruleTester.run('jsx-handler-names', rule, {
265265
],
266266
},
267267
{
268-
code: '<TestComponent only={this.handleChange} />',
268+
code: '<TestComponent2 only={this.handleChange} />',
269269
errors: [
270270
{
271271
messageId: 'badPropKey',

tests/lib/rules/jsx-no-leaked-render.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,6 @@ ruleTester.run('jsx-no-leaked-render', rule, {
126126
`,
127127
options: [{ validStrategies: ['coerce', 'ternary'] }],
128128
},
129-
{
130-
code: `
131-
const Component = ({ elements, count }) => {
132-
return <div>{!!count && <List elements={elements}/>}</div>
133-
}
134-
`,
135-
options: [{ validStrategies: ['coerce'] }],
136-
},
137129

138130
// Fixes for:
139131
// - https://github.com/jsx-eslint/eslint-plugin-react/issues/3292

tests/lib/rules/jsx-one-expression-per-line.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -937,26 +937,6 @@ foo
937937
<App>
938938
<Foo></
939939
Foo>
940-
</App>
941-
`,
942-
errors: [
943-
{
944-
messageId: 'moveToNewLine',
945-
data: { descriptor: 'Foo' },
946-
},
947-
],
948-
parserOptions,
949-
},
950-
{
951-
code: `
952-
<App>
953-
<Foo></
954-
Foo></App>
955-
`,
956-
output: `
957-
<App>
958-
<Foo></
959-
Foo>
960940
</App>
961941
`,
962942
errors: [

tests/lib/rules/jsx-wrap-multilines.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,16 +1393,6 @@ ruleTester.run('jsx-wrap-multilines', rule, {
13931393
{ messageId: 'parensOnNewLines' },
13941394
],
13951395
},
1396-
{
1397-
code: DECLARATION_TERNARY_PAREN_FRAGMENT,
1398-
features: ['fragment'],
1399-
output: addNewLineSymbols(DECLARATION_TERNARY_PAREN_FRAGMENT),
1400-
options: [{ declaration: 'parens-new-line' }],
1401-
errors: [
1402-
{ messageId: 'parensOnNewLines' },
1403-
{ messageId: 'parensOnNewLines' },
1404-
],
1405-
},
14061396
{
14071397
code: ASSIGNMENT_TERNARY_NO_PAREN,
14081398
output: addNewLineSymbols(ASSIGNMENT_TERNARY_PAREN),

tests/lib/rules/no-redundant-should-component-update.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@ ruleTester.run('no-redundant-should-component-update', rule, {
3737
`,
3838
parserOptions,
3939
},
40-
{
41-
code: `
42-
class Foo extends React.Component {
43-
shouldComponentUpdate() {
44-
return true;
45-
}
46-
}
47-
`,
48-
parserOptions,
49-
},
5040
{
5141
code: `
5242
class Foo extends React.Component {

0 commit comments

Comments
 (0)