@@ -182,7 +182,7 @@ describe('render', () => {
182
182
. and . calledWithExactly (
183
183
match ( {
184
184
foo : 'test' ,
185
- children : [ 'content' ]
185
+ children : 'content'
186
186
} ) ,
187
187
match ( { } )
188
188
) ;
@@ -205,9 +205,7 @@ describe('render', () => {
205
205
. and . calledWithExactly (
206
206
match ( {
207
207
foo : 1 ,
208
- children : [
209
- match ( { nodeName : 'span' , children : [ 'asdf' ] } )
210
- ]
208
+ children : match ( { type : 'span' , props : { children : 'asdf' } } )
211
209
} ) ,
212
210
match ( { } )
213
211
) ;
@@ -240,7 +238,7 @@ describe('render', () => {
240
238
241
239
const PROPS = {
242
240
foo : 'test' ,
243
- children : [ 'content' ]
241
+ children : 'content'
244
242
} ;
245
243
246
244
expect ( rendered )
@@ -254,8 +252,8 @@ describe('render', () => {
254
252
. to . have . been . calledOnce
255
253
. and . calledWithExactly (
256
254
match ( PROPS ) ,
257
- match ( { } ) , // empty state
258
- match ( { } ) // empty context
255
+ match . falsy ,
256
+ match ( { } ) // empty context
259
257
) ;
260
258
} ) ;
261
259
@@ -284,11 +282,9 @@ describe('render', () => {
284
282
. and . calledWithExactly (
285
283
match ( {
286
284
foo : 1 ,
287
- children : [
288
- match ( { nodeName : 'span' , children : [ 'asdf' ] } )
289
- ]
285
+ children : match ( { type : 'span' , props : { children : 'asdf' } } )
290
286
} ) ,
291
- match ( { } ) , // empty state
287
+ match . falsy ,
292
288
match ( { } )
293
289
) ;
294
290
} ) ;
@@ -389,13 +385,13 @@ describe('render', () => {
389
385
render ( < Outer /> ) ;
390
386
391
387
expect ( Outer . prototype . getChildContext ) . to . have . been . calledOnce ;
392
- expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , { } , CONTEXT ) ;
388
+ expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , match . falsy , CONTEXT ) ;
393
389
394
390
CONTEXT . foo = 'bar' ;
395
391
render ( < Outer { ...PROPS } /> ) ;
396
392
397
393
expect ( Outer . prototype . getChildContext ) . to . have . been . calledTwice ;
398
- expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( PROPS ) , { } , CONTEXT ) ;
394
+ expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( PROPS ) , match . falsy , CONTEXT ) ;
399
395
} ) ;
400
396
401
397
it ( 'should pass context to direct children' , ( ) => {
@@ -422,16 +418,16 @@ describe('render', () => {
422
418
render ( < Outer /> ) ;
423
419
424
420
expect ( Outer . prototype . getChildContext ) . to . have . been . calledOnce ;
425
- expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , { } , CONTEXT ) ;
421
+ expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , match . falsy , CONTEXT ) ;
426
422
427
423
CONTEXT . foo = 'bar' ;
428
424
render ( < Outer { ...PROPS } /> ) ;
429
425
430
426
expect ( Outer . prototype . getChildContext ) . to . have . been . calledTwice ;
431
- expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( PROPS ) , { } , CONTEXT ) ;
427
+ expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( PROPS ) , match . falsy , CONTEXT ) ;
432
428
433
429
// make sure render() could make use of context.a
434
- expect ( Inner . prototype . render ) . to . have . returned ( match ( { children : [ 'a' ] } ) ) ;
430
+ expect ( Inner . prototype . render ) . to . have . returned ( match ( { props : { children : 'a' } } ) ) ;
435
431
} ) ;
436
432
437
433
it ( 'should preserve existing context properties when creating child contexts' , ( ) => {
@@ -466,8 +462,8 @@ describe('render', () => {
466
462
467
463
render ( < Outer /> ) ;
468
464
469
- expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , { } , { outerContext } ) ;
470
- expect ( InnerMost . prototype . render ) . to . have . been . calledWith ( match ( { } ) , { } , { outerContext, innerContext } ) ;
465
+ expect ( Inner . prototype . render ) . to . have . been . calledWith ( match ( { } ) , match . falsy , { outerContext } ) ;
466
+ expect ( InnerMost . prototype . render ) . to . have . been . calledWith ( match ( { } ) , match . falsy , { outerContext, innerContext } ) ;
471
467
} ) ;
472
468
} ) ;
473
469
@@ -573,7 +569,7 @@ describe('render', () => {
573
569
} ) ;
574
570
575
571
describe ( 'state locking' , ( ) => {
576
- it ( 'should set _disable and __x to true' , ( ) => {
572
+ it ( 'should set _dirty and __d to true' , ( ) => {
577
573
let inst ;
578
574
class Foo extends Component {
579
575
constructor ( props , context ) {
@@ -587,8 +583,8 @@ describe('render', () => {
587
583
588
584
expect ( render ( < Foo /> ) ) . to . equal ( '<div></div>' ) ;
589
585
590
- expect ( inst ) . to . have . property ( '_disable ' , true ) ;
591
- expect ( inst ) . to . have . property ( '__x ' , true ) ;
586
+ expect ( inst ) . to . have . property ( '_dirty ' , true ) ;
587
+ expect ( inst ) . to . have . property ( '__d ' , true ) ;
592
588
} ) ;
593
589
594
590
it ( 'should prevent re-rendering' , ( ) => {
@@ -597,7 +593,7 @@ describe('render', () => {
597
593
let count = 0 ;
598
594
599
595
class Foo extends Component {
600
- componentWillMount ( ) {
596
+ componentDidMount ( ) {
601
597
this . forceUpdate ( ) ;
602
598
}
603
599
render ( ) {
0 commit comments