File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -454,6 +454,13 @@ describe("DataSnapshot", () => {
454454 expect ( subject . child ( "a" ) . val ( ) ) . to . deep . equal ( { b : "c" , d : "e" } ) ;
455455 } ) ;
456456
457+ it ( "should return null for null data" , ( ) => {
458+ populate ( null ) ;
459+ expect ( subject . val ( ) ) . to . be . null ;
460+ expect ( subject . child ( "a" ) . val ( ) ) . to . be . null ;
461+ expect ( subject . child ( "a/b" ) . val ( ) ) . to . be . null ;
462+ } ) ;
463+
457464 it ( "should return null for children past a leaf" , ( ) => {
458465 populate ( applyChange ( { a : 23 } , { b : 33 } ) ) ;
459466 expect ( subject . child ( "a/b" ) . val ( ) ) . to . be . null ;
@@ -466,6 +473,8 @@ describe("DataSnapshot", () => {
466473 expect ( subject . val ( ) ) . to . eq ( 23 ) ;
467474 populate ( { b : 23 , a : null } ) ;
468475 expect ( subject . child ( "b" ) . val ( ) ) . to . eq ( 23 ) ;
476+ expect ( subject . child ( "a" ) . val ( ) ) . to . be . null ;
477+ expect ( subject . child ( "a/c" ) . val ( ) ) . to . be . null ;
469478 } ) ;
470479
471480 it ( "should coerce object into array if all keys are integers" , ( ) => {
You can’t perform that action at this time.
0 commit comments