@@ -152,8 +152,61 @@ describe("object with function property", () => {
152
152
const keyNodes = { Item : { } } ;
153
153
const nativeAttrObj = { Item : { id : 1 , func : ( ) => { } } , ...notAttrValue } ;
154
154
const attrObj = { Item : { id : { N : "1" } } , ...notAttrValue } ;
155
-
156
155
it ( marshallInput . name , ( ) => {
157
156
expect ( marshallInput ( nativeAttrObj , keyNodes , { convertTopLevelContainer : true } ) ) . toEqual ( attrObj ) ;
158
157
} ) ;
158
+
159
+ // List of functions
160
+ const listOfFunctions = { Item : { id : 1 , funcs : [ ( ) => { } , ( ) => { } ] } , ...notAttrValue } ;
161
+ it ( marshallInput . name , ( ) => {
162
+ expect (
163
+ marshallInput ( listOfFunctions , keyNodes , { convertTopLevelContainer : true , convertClassInstanceToMap : true } )
164
+ ) . toEqual ( attrObj ) ;
165
+ } ) ;
166
+
167
+ // Nested list of functions
168
+ const nestedListOfFunctions = {
169
+ Item : {
170
+ id : 1 ,
171
+ funcs : [
172
+ [ ( ) => { } , ( ) => { } ] ,
173
+ [ ( ) => { } , ( ) => { } ] ,
174
+ ] ,
175
+ } ,
176
+ ...notAttrValue ,
177
+ } ;
178
+ it ( marshallInput . name , ( ) => {
179
+ expect (
180
+ marshallInput ( nestedListOfFunctions , keyNodes , {
181
+ convertTopLevelContainer : true ,
182
+ convertClassInstanceToMap : true ,
183
+ } )
184
+ ) . toEqual ( attrObj ) ;
185
+ } ) ;
186
+
187
+ // Nested list of functions 3 levels down
188
+ const nestedListOfFunctions3Levels = {
189
+ Item : {
190
+ id : 1 ,
191
+ funcs : [
192
+ [
193
+ [ ( ) => { } , ( ) => { } ] ,
194
+ [ ( ) => { } , ( ) => { } ] ,
195
+ ] ,
196
+ [
197
+ [ ( ) => { } , ( ) => { } ] ,
198
+ [ ( ) => { } , ( ) => { } ] ,
199
+ ] ,
200
+ ] ,
201
+ } ,
202
+ ...notAttrValue ,
203
+ } ;
204
+ it ( marshallInput . name , ( ) => {
205
+ expect (
206
+ marshallInput ( nestedListOfFunctions3Levels , keyNodes , {
207
+ convertTopLevelContainer : true ,
208
+ convertClassInstanceToMap : true ,
209
+ } )
210
+ ) . toEqual ( attrObj ) ;
211
+ } ) ;
159
212
} ) ;
0 commit comments