File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
app/code/Magento/Bundle/view/adminhtml/web/js/components
dev/tests/js/jasmine/tests/app/code/Magento/Bundle/adminhtml/js/components Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ define([
179179 } ,
180180
181181 /**
182- * Processing add child if the record index is not a number.
182+ * Parse and processing the add child method to update the latest records if the record index is not a number.
183183 *
184184 * @param {Array } data
185185 * @param {Array } newData
Original file line number Diff line number Diff line change 1+ /************************************************************************
2+ *
3+ * Copyright 2024 Adobe
4+ * All Rights Reserved.
5+ *
6+ * ************************************************************************
7+ */
8+ /*eslint max-nested-callbacks: 0*/
9+ define ( [ 'Magento_Bundle/js/components/bundle-dynamic-rows-grid' ] ,
10+ function ( BundleDynamicRowsGrid ) {
11+ 'use strict' ;
12+
13+ describe ( 'Magento_Bundle/js/components/bundle-dynamic-rows-grid' , function ( ) {
14+ let dynamicRowsGrid ;
15+
16+ beforeEach ( function ( ) {
17+ dynamicRowsGrid = new BundleDynamicRowsGrid ( ) ;
18+ } ) ;
19+
20+ describe ( 'test parseProcessingAddChild method' , function ( ) {
21+ it ( 'Check the processingAddChild method should call when recordIndex is a valid number' , function ( ) {
22+ let data = [ 4 ] ;
23+ let newData = [ 4 ] ;
24+
25+ spyOn ( dynamicRowsGrid , 'processingAddChild' ) . and . callThrough ( ) ;
26+
27+ dynamicRowsGrid . parseProcessingAddChild ( data , newData ) ;
28+
29+ expect ( dynamicRowsGrid . processingAddChild ) . toHaveBeenCalled ( ) ;
30+ } ) ;
31+
32+ it ( 'Check the processingAddChild method should not call when recordIndex is inValid number' , function ( ) {
33+ let data = NaN ;
34+ let newData = [ 2 ] ;
35+
36+ spyOn ( dynamicRowsGrid , 'processingAddChild' ) . and . callThrough ( ) ;
37+
38+ dynamicRowsGrid . parseProcessingAddChild ( data , newData ) ;
39+
40+ expect ( dynamicRowsGrid . processingAddChild ) . not . toHaveBeenCalled ( ) ;
41+ } ) ;
42+ } ) ;
43+ } ) ;
44+ } ) ;
You can’t perform that action at this time.
0 commit comments