@@ -3,7 +3,7 @@ const attributesToProps = require('../lib/attributes-to-props');
3
3
const utilities = require ( '../lib/utilities' ) ;
4
4
5
5
describe ( 'attributesToProps' , ( ) => {
6
- describe ( 'HTML DOM ' , ( ) => {
6
+ describe ( 'HTML' , ( ) => {
7
7
it ( 'converts attributes to React props' , ( ) => {
8
8
assert . deepEqual (
9
9
attributesToProps ( {
@@ -19,7 +19,7 @@ describe('attributesToProps', () => {
19
19
) ;
20
20
} ) ;
21
21
22
- it ( 'converts standard properties to React props' , ( ) => {
22
+ it ( 'converts standard attributes to React props' , ( ) => {
23
23
assert . deepEqual (
24
24
attributesToProps ( {
25
25
allowfullscreen : true ,
@@ -34,7 +34,7 @@ describe('attributesToProps', () => {
34
34
) ;
35
35
} ) ;
36
36
37
- it ( 'converts RDFa properties to React props' , ( ) => {
37
+ it ( 'converts RDFa attributes to React props' , ( ) => {
38
38
assert . deepEqual (
39
39
attributesToProps ( {
40
40
property : 'foo' ,
@@ -47,7 +47,7 @@ describe('attributesToProps', () => {
47
47
) ;
48
48
} ) ;
49
49
50
- it ( 'converts non-standard properties to React props' , ( ) => {
50
+ it ( 'converts non-standard attributes to React props' , ( ) => {
51
51
assert . deepEqual (
52
52
attributesToProps ( {
53
53
itemscope : true ,
@@ -73,7 +73,7 @@ describe('attributesToProps', () => {
73
73
) ;
74
74
} ) ;
75
75
76
- it ( 'converts properties with weird capitalization' , ( ) => {
76
+ it ( 'converts attributes with weird capitalization' , ( ) => {
77
77
assert . deepEqual (
78
78
attributesToProps ( {
79
79
'ACCEPT-CHARSET' : 'ISO-8859-1' ,
@@ -90,7 +90,7 @@ describe('attributesToProps', () => {
90
90
) ;
91
91
} ) ;
92
92
93
- it ( 'converts bool properties ' , ( ) => {
93
+ it ( 'converts boolean attributes ' , ( ) => {
94
94
assert . deepEqual (
95
95
attributesToProps ( {
96
96
readonly : ''
@@ -111,8 +111,8 @@ describe('attributesToProps', () => {
111
111
} ) ;
112
112
} ) ;
113
113
114
- describe ( 'SVG DOM properties ' , ( ) => {
115
- it ( 'converts attributes/properties to React props' , ( ) => {
114
+ describe ( 'SVG' , ( ) => {
115
+ it ( 'converts attributes to React props' , ( ) => {
116
116
assert . deepEqual (
117
117
attributesToProps ( {
118
118
edgeMode : 'edgeMode' ,
@@ -152,8 +152,7 @@ describe('attributesToProps', () => {
152
152
} ) ;
153
153
154
154
describe ( 'style' , ( ) => {
155
- it ( 'converts CSS style string to JS style object' , ( ) => {
156
- // proper css
155
+ it ( 'converts inline style to object' , ( ) => {
157
156
assert . deepEqual (
158
157
attributesToProps ( {
159
158
style :
@@ -171,7 +170,6 @@ describe('attributesToProps', () => {
171
170
}
172
171
) ;
173
172
174
- // valid but messy
175
173
assert . deepEqual (
176
174
attributesToProps ( {
177
175
style :
@@ -187,7 +185,6 @@ describe('attributesToProps', () => {
187
185
}
188
186
) ;
189
187
190
- // style is null
191
188
assert . deepEqual (
192
189
attributesToProps ( {
193
190
style : null
@@ -197,7 +194,6 @@ describe('attributesToProps', () => {
197
194
}
198
195
) ;
199
196
200
- // style is undefined
201
197
assert . deepEqual (
202
198
attributesToProps ( {
203
199
style : undefined
@@ -207,7 +203,6 @@ describe('attributesToProps', () => {
207
203
}
208
204
) ;
209
205
210
- // style is empty string
211
206
assert . deepEqual (
212
207
attributesToProps ( {
213
208
style : ''
@@ -218,7 +213,7 @@ describe('attributesToProps', () => {
218
213
) ;
219
214
} ) ;
220
215
221
- [ Object , Array , Number , Date ] . forEach ( type => {
216
+ [ Object , Array , Number , Date , Function ] . forEach ( type => {
222
217
it ( `throws an error when attributes.style=${ type . name } ` , ( ) => {
223
218
assert . throws (
224
219
( ) => {
@@ -244,7 +239,7 @@ describe('attributesToProps', () => {
244
239
utilities . PRESERVE_CUSTOM_ATTRIBUTES = PRESERVE_CUSTOM_ATTRIBUTES ;
245
240
} ) ;
246
241
247
- it ( 'does not include unknown attributes' , ( ) => {
242
+ it ( 'omits unknown attributes' , ( ) => {
248
243
assert . deepEqual (
249
244
attributesToProps ( {
250
245
unknownAttribute : 'someValue'
0 commit comments