Skip to content

Commit a1d3605

Browse files
authored
ENGCOM-6483: #25591 & character in SKUs is shown as & in current variations li… #26007
2 parents ce88b46 + 15834d5 commit a1d3605

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/components/dynamic-rows-configurable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ define([
219219
_.each(tmpData, function (row, index) {
220220
path = this.dataScope + '.' + this.index + '.' + (this.startIndex + index);
221221
row.attributes = $('<i></i>').text(row.attributes).html();
222-
row.sku = $('<i></i>').text(row.sku).html();
222+
row.sku = row.sku;
223223
this.source.set(path, row);
224224
}, this);
225225

@@ -405,7 +405,7 @@ define([
405405
'id': row.productId,
406406
'product_link': row.productUrl,
407407
'name': $('<i></i>').text(row.name).html(),
408-
'sku': $('<i></i>').text(row.sku).html(),
408+
'sku': row.sku,
409409
'status': row.status,
410410
'price': row.price,
411411
'price_currency': row.priceCurrency,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
/* eslint-disable max-nested-callbacks */
7+
define([
8+
'jquery',
9+
'Magento_ConfigurableProduct/js/components/dynamic-rows-configurable',
10+
'Magento_Ui/js/dynamic-rows/dynamic-rows'
11+
], function ($, DynamicRowsConf, DynamicRows) {
12+
'use strict';
13+
14+
describe('Magento_ConfigurableProduct/js/components/dynamic-rows-configurable', function () {
15+
var model;
16+
17+
beforeEach(function () {
18+
model = new DynamicRowsConf(new DynamicRows({
19+
isEmpty: jasmine.createSpy().and.returnValue(1),
20+
isShowAddProductButton: jasmine.createSpy().and.returnValue(1)
21+
}));
22+
23+
});
24+
25+
it('Verify processingUnionInsertDat method', function () {
26+
var expectedData = [],
27+
mockData = [
28+
{
29+
attributes: 'Color: dsfsd',
30+
sku: 'Conf&-sdfs'
31+
},
32+
{
33+
attributes: 'Color: sdfs',
34+
sku: 'Conf-dsfsd'
35+
}
36+
],
37+
sourceMock = {
38+
get: jasmine.createSpy().and.returnValue(['code1', 'code2']),
39+
set: jasmine.createSpy().and.callFake(function (path, row) {
40+
expectedData.push(row);
41+
})
42+
};
43+
44+
model.getChildItems = jasmine.createSpy().and.returnValue($(''));
45+
model.source = sourceMock;
46+
model.processingUnionInsertData(mockData);
47+
expect(model.source.get).toHaveBeenCalled();
48+
expect(model.getChildItems).toHaveBeenCalled();
49+
expect(expectedData[1].sku).toBe('Conf&-sdfs');
50+
});
51+
52+
});
53+
});

0 commit comments

Comments
 (0)