File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,20 @@ describe('Test lib.js:', function() {
590
590
expect ( computed ) . toLooseDeepEqual ( expected ) ;
591
591
} ) ;
592
592
593
+ it ( 'does not skip over array container set to null values' , function ( ) {
594
+ var input = { title : 'clear annotations' , annotations : null } ;
595
+ var expected = { title : 'clear annotations' , annotations : null } ;
596
+ var computed = Lib . expandObjectPaths ( input ) ;
597
+ expect ( computed ) . toLooseDeepEqual ( expected ) ;
598
+ } ) ;
599
+
600
+ it ( 'expands array containers' , function ( ) {
601
+ var input = { title : 'clear annotation 1' , 'annotations[1]' : { title : 'new' } } ;
602
+ var expected = { title : 'clear annotation 1' , annotations : [ null , { title : 'new' } ] } ;
603
+ var computed = Lib . expandObjectPaths ( input ) ;
604
+ expect ( computed ) . toLooseDeepEqual ( expected ) ;
605
+ } ) ;
606
+
593
607
// TODO: This test is unimplemented since it's a currently-unused corner case.
594
608
// Getting the test to pass requires some extension (pun?) to extendDeepNoArrays
595
609
// that's intelligent enough to only selectively merge *some* arrays, in particular
You can’t perform that action at this time.
0 commit comments