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 11/**
2- * Copyright © Magento, Inc. All rights reserved.
3- * See COPYING.txt for license details .
2+ * Copyright 2017 Adobe
3+ * All Rights Reserved .
44 */
55
66/* eslint-disable max-nested-callbacks */
@@ -204,5 +204,36 @@ define([
204204 expect ( model . pages ( ) ) . toEqual ( 2 ) ;
205205 expect ( model . currentPage ( ) ) . toEqual ( 2 ) ;
206206 } ) ;
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+ } ) ;
207238 } ) ;
208239} ) ;
You can’t perform that action at this time.
0 commit comments