Skip to content

Commit c018ea4

Browse files
committed
ACP2E-2909: dynamic-rows.js:658 Uncaught TypeError: dataRecord.slice while editing bundle products
- Fixed the static test failure.
1 parent 968532b commit c018ea4

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

app/code/Magento/Bundle/view/adminhtml/web/js/components/bundle-dynamic-rows-grid.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ define([
184184
* @param {Array} data
185185
* @param {Array} newData
186186
*/
187-
parseProcessingAddChild: function(data, newData) {
187+
parseProcessingAddChild: function (data, newData) {
188188
let recordIndex;
189+
189190
recordIndex = data.length - newData.length - 1;
190191
if (!isNaN(recordIndex)) {
191192
_.each(newData, function (newRecord) {

dev/tests/js/jasmine/tests/app/code/Magento/Bundle/adminhtml/js/components/bundle-dynamic-rows-grid.test.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
/*eslint max-nested-callbacks: 0*/
99
define(['Magento_Bundle/js/components/bundle-dynamic-rows-grid'],
10-
function(BundleDynamicRowsGrid) {
10+
function (BundleDynamicRowsGrid) {
1111
'use strict';
1212

1313
describe('Magento_Bundle/js/components/bundle-dynamic-rows-grid', function () {
@@ -17,10 +17,9 @@ define(['Magento_Bundle/js/components/bundle-dynamic-rows-grid'],
1717
dynamicRowsGrid = new BundleDynamicRowsGrid();
1818
});
1919

20-
describe('test parseProcessingAddChild method', function() {
20+
describe('test parseProcessingAddChild method', function () {
2121
it('Check the processingAddChild method should call when recordIndex is a valid number', function () {
22-
let data = [4];
23-
let newData = [4];
22+
let data = [4], newData = [4];
2423

2524
spyOn(dynamicRowsGrid, 'processingAddChild').and.callThrough();
2625

@@ -29,16 +28,16 @@ define(['Magento_Bundle/js/components/bundle-dynamic-rows-grid'],
2928
expect(dynamicRowsGrid.processingAddChild).toHaveBeenCalled();
3029
});
3130

32-
it('Check the processingAddChild method should not call when recordIndex is inValid number', function () {
33-
let data = NaN;
34-
let newData = [2];
31+
it('Check the processingAddChild method should not call when recordIndex is inValid number',
32+
function () {
33+
let data = NaN, newData = [2];
3534

36-
spyOn(dynamicRowsGrid, 'processingAddChild').and.callThrough();
35+
spyOn(dynamicRowsGrid, 'processingAddChild').and.callThrough();
3736

38-
dynamicRowsGrid.parseProcessingAddChild(data, newData);
37+
dynamicRowsGrid.parseProcessingAddChild(data, newData);
3938

40-
expect(dynamicRowsGrid.processingAddChild).not.toHaveBeenCalled();
41-
});
39+
expect(dynamicRowsGrid.processingAddChild).not.toHaveBeenCalled();
40+
});
4241
});
4342
});
4443
});

0 commit comments

Comments
 (0)