File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/dynamic-rows Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright © Magento, Inc. All rights reserved.
3
- * See COPYING.txt for license details .
2
+ * Copyright 2017 Adobe
3
+ * All Rights Reserved .
4
4
*/
5
5
6
6
/* eslint-disable max-nested-callbacks */
@@ -204,5 +204,36 @@ define([
204
204
expect ( model . pages ( ) ) . toEqual ( 2 ) ;
205
205
expect ( model . currentPage ( ) ) . toEqual ( 2 ) ;
206
206
} ) ;
207
+
208
+ it ( 'should process pages before addChild' , function ( ) {
209
+ var ctx = { } ; // Mock context
210
+ var index = 5 ;
211
+ var prop = 'someProp' ;
212
+ model . pageSize = 2 ;
213
+ model . relatedData = [
214
+ {
215
+ name : 'first'
216
+ } ,
217
+ {
218
+ name : 'second'
219
+ } ,
220
+ {
221
+ name : 'third'
222
+ } ,
223
+ {
224
+ name : 'fourth'
225
+ } ,
226
+ {
227
+ name : 'fifth'
228
+ }
229
+ ] ;
230
+ model . bubble = jasmine . createSpy ( ) ;
231
+ model . addChild = jasmine . createSpy ( ) ;
232
+ model . processingAddChild ( ctx , index , prop ) ;
233
+ expect ( model . bubble ) . toHaveBeenCalledWith ( 'addChild' , false ) ;
234
+ expect ( model . pages ( ) ) . toEqual ( 3 ) ;
235
+ expect ( model . currentPage ( ) ) . toEqual ( 3 ) ;
236
+ expect ( model . addChild ) . toHaveBeenCalledWith ( ctx , index , prop ) ;
237
+ } ) ;
207
238
} ) ;
208
239
} ) ;
You can’t perform that action at this time.
0 commit comments