@@ -30,37 +30,66 @@ ruleTester.run('self-closing-comp', rule, {
3030 valid : [
3131 {
3232 code : 'var HelloJohn = <Hello name="John" />;'
33+ } , {
34+ code : 'var HelloJohn = <Hello.Compound name="John" />;'
3335 } , {
3436 code : 'var Profile = <Hello name="John"><img src="picture.png" /></Hello>;'
37+ } , {
38+ code : 'var Profile = <Hello.Compound name="John"><img src="picture.png" /></Hello.Compound>;'
3539 } , {
3640 code : `
3741 <Hello>
3842 <Hello name="John" />
3943 </Hello>
4044 `
45+ } , {
46+ code : `
47+ <Hello.Compound>
48+ <Hello.Compound name="John" />
49+ </Hello.Compound>
50+ `
4151 } , {
4252 code : 'var HelloJohn = <Hello name="John"> </Hello>;'
53+ } , {
54+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
4355 } , {
4456 code : 'var HelloJohn = <Hello name="John"> </Hello>;'
57+ } , {
58+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
4559 } , {
4660 code : 'var HelloJohn = <div> </div>;'
4761 } , {
4862 code : 'var HelloJohn = <div>{\' \'}</div>;'
4963 } , {
5064 code : 'var HelloJohn = <Hello name="John"> </Hello>;'
65+ } , {
66+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;'
5167 } , {
5268 code : 'var HelloJohn = <Hello name="John" />;' ,
5369 options : [ ]
70+ } , {
71+ code : 'var HelloJohn = <Hello.Compound name="John" />;' ,
72+ options : [ ]
5473 } , {
5574 code : 'var Profile = <Hello name="John"><img src="picture.png" /></Hello>;' ,
5675 options : [ ]
76+ } , {
77+ code : 'var Profile = <Hello.Compound name="John"><img src="picture.png" /></Hello.Compound>;' ,
78+ options : [ ]
5779 } , {
5880 code : `
5981 <Hello>
6082 <Hello name="John" />
6183 </Hello>
6284 ` ,
6385 options : [ ]
86+ } , {
87+ code : `
88+ <Hello.Compound>
89+ <Hello.Compound name="John" />
90+ </Hello.Compound>
91+ ` ,
92+ options : [ ]
6493 } , {
6594 code : 'var HelloJohn = <div> </div>;' ,
6695 options : [ ]
@@ -76,15 +105,27 @@ ruleTester.run('self-closing-comp', rule, {
76105 } , {
77106 code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
78107 options : [ ]
108+ } , {
109+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;' ,
110+ options : [ ]
79111 } , {
80112 code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
81113 options : [ { component : false } ]
114+ } , {
115+ code : 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
116+ options : [ { component : false } ]
82117 } , {
83118 code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
84119 options : [ { component : false } ]
120+ } , {
121+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
122+ options : [ { component : false } ]
85123 } , {
86124 code : 'var HelloJohn = <Hello name="John"> </Hello>;' ,
87125 options : [ { component : false } ]
126+ } , {
127+ code : 'var HelloJohn = <Hello.Compound name="John"> </Hello.Compound>;' ,
128+ options : [ { component : false } ]
88129 } , {
89130 code : 'var contentContainer = <div className="content" />;' ,
90131 options : [ { html : true } ]
@@ -121,26 +162,52 @@ ruleTester.run('self-closing-comp', rule, {
121162 errors : [ {
122163 message : 'Empty components are self-closing'
123164 } ]
165+ } , {
166+ code : 'var CompoundHelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
167+ output : 'var CompoundHelloJohn = <Hello.Compound name="John" />;' ,
168+ errors : [ {
169+ message : 'Empty components are self-closing'
170+ } ]
124171 } , {
125172 code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
126173 output : 'var HelloJohn = <Hello name="John" />;' ,
127174 errors : [ {
128175 message : 'Empty components are self-closing'
129176 } ]
177+ } , {
178+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
179+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
180+ errors : [ {
181+ message : 'Empty components are self-closing'
182+ } ]
130183 } , {
131184 code : 'var HelloJohn = <Hello name="John"></Hello>;' ,
132185 output : 'var HelloJohn = <Hello name="John" />;' ,
133186 options : [ ] ,
134187 errors : [ {
135188 message : 'Empty components are self-closing'
136189 } ]
190+ } , {
191+ code : 'var HelloJohn = <Hello.Compound name="John"></Hello.Compound>;' ,
192+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
193+ options : [ ] ,
194+ errors : [ {
195+ message : 'Empty components are self-closing'
196+ } ]
137197 } , {
138198 code : 'var HelloJohn = <Hello name="John">\n</Hello>;' ,
139199 output : 'var HelloJohn = <Hello name="John" />;' ,
140200 options : [ ] ,
141201 errors : [ {
142202 message : 'Empty components are self-closing'
143203 } ]
204+ } , {
205+ code : 'var HelloJohn = <Hello.Compound name="John">\n</Hello.Compound>;' ,
206+ output : 'var HelloJohn = <Hello.Compound name="John" />;' ,
207+ options : [ ] ,
208+ errors : [ {
209+ message : 'Empty components are self-closing'
210+ } ]
144211 } , {
145212 code : 'var contentContainer = <div className="content"></div>;' ,
146213 output : 'var contentContainer = <div className="content" />;' ,
0 commit comments