File tree Expand file tree Collapse file tree 1 file changed +32
-6
lines changed Expand file tree Collapse file tree 1 file changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,38 @@ describe('render()', () => {
252
252
. and . matches ( / p o s i t i o n \s * : \s * r e l a t i v e \s * / ) ;
253
253
} ) ;
254
254
255
+ it ( 'should properly switch from string styles to object styles and back' , ( ) => {
256
+ let root = render ( (
257
+ < div style = "display: inline;" > test</ div >
258
+ ) , scratch ) ;
259
+
260
+ expect ( root . style . cssText ) . to . equal ( 'display: inline;' ) ;
261
+
262
+ root = render ( (
263
+ < div style = { { color : 'red' } } />
264
+ ) , scratch , root ) ;
265
+
266
+ expect ( root . style . cssText ) . to . equal ( 'color: red;' ) ;
267
+
268
+ root = render ( (
269
+ < div style = "color: blue" />
270
+ ) , scratch , root ) ;
271
+
272
+ expect ( root . style . cssText ) . to . equal ( 'color: blue;' ) ;
273
+
274
+ root = render ( (
275
+ < div style = { { color : 'yellow' } } />
276
+ ) , scratch , root ) ;
277
+
278
+ expect ( root . style . cssText ) . to . equal ( 'color: yellow;' ) ;
279
+
280
+ root = render ( (
281
+ < div style = "display: block" />
282
+ ) , scratch , root ) ;
283
+
284
+ expect ( root . style . cssText ) . to . equal ( 'display: block;' ) ;
285
+ } ) ;
286
+
255
287
it ( 'should serialize style objects' , ( ) => {
256
288
let root = render ( (
257
289
< div style = { {
@@ -283,12 +315,6 @@ describe('render()', () => {
283
315
284
316
expect ( root . style . cssText ) . to . equal ( 'color: rgb(0, 255, 255);' ) ;
285
317
286
- root = render ( (
287
- < div style = "display: inline;" > test</ div >
288
- ) , scratch , root ) ;
289
-
290
- expect ( root . style . cssText ) . to . equal ( 'display: inline;' ) ;
291
-
292
318
root = render ( (
293
319
< div style = { { backgroundColor : 'rgb(0, 255, 255)' } } > test</ div >
294
320
) , scratch , root ) ;
You can’t perform that action at this time.
0 commit comments