@@ -75,4 +75,31 @@ describe('ObjectUtil', () => {
7575 '.array[1].prop'
7676 ] ) ;
7777 } ) ;
78+
79+ it ( 'getValueIgnoreCase returns correct results' , ( ) => {
80+ const object = {
81+ foo : 1 ,
82+ BAR : 2 ,
83+ KaLLe : 3
84+ } ;
85+
86+ let result1 = ObjectUtil . getValueIgnoreCase ( object , 'foo' ) ;
87+ expect ( result1 ) . to . equal ( 1 ) ;
88+ result1 = ObjectUtil . getValueIgnoreCase ( object , 'FOO' ) ;
89+ expect ( result1 ) . to . equal ( 1 ) ;
90+ result1 = ObjectUtil . getValueIgnoreCase ( object , 'fOO' ) ;
91+ expect ( result1 ) . to . equal ( 1 ) ;
92+ let result2 = ObjectUtil . getValueIgnoreCase ( object , 'bar' ) ;
93+ expect ( result2 ) . to . equal ( 2 ) ;
94+ result2 = ObjectUtil . getValueIgnoreCase ( object , 'BAR' ) ;
95+ expect ( result2 ) . to . equal ( 2 ) ;
96+ result2 = ObjectUtil . getValueIgnoreCase ( object , 'bAr' ) ;
97+ expect ( result2 ) . to . equal ( 2 ) ;
98+ let result3 = ObjectUtil . getValueIgnoreCase ( object , 'kalle' ) ;
99+ expect ( result3 ) . to . equal ( 3 ) ;
100+ result3 = ObjectUtil . getValueIgnoreCase ( object , 'KALLE' ) ;
101+ expect ( result3 ) . to . equal ( 3 ) ;
102+ result3 = ObjectUtil . getValueIgnoreCase ( object , 'kAlle' ) ;
103+ expect ( result3 ) . to . equal ( 3 ) ;
104+ } ) ;
78105} ) ;
0 commit comments