Skip to content

Commit b5d921b

Browse files
committed
MC-4126: Duplicate row border after switching Row appearance
- Polyfill Object.assign for jasmine tests which use TypeScript generated components
1 parent 34edd3d commit b5d921b

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// jscs:disable
2+
/* eslint-disable */
3+
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill
4+
if (typeof Object.assign != 'function') {
5+
(function () {
6+
Object.assign = function (target) {
7+
'use strict';
8+
if (target === undefined || target === null) {
9+
throw new TypeError('Cannot convert undefined or null to object');
10+
}
11+
12+
var output = Object(target);
13+
for (var index = 1; index < arguments.length; index++) {
14+
var source = arguments[index];
15+
if (source !== undefined && source !== null) {
16+
for (var nextKey in source) {
17+
if (source.hasOwnProperty(nextKey)) {
18+
output[nextKey] = source[nextKey];
19+
}
20+
}
21+
}
22+
}
23+
return output;
24+
};
25+
})();
26+
}

dev/tests/js/jasmine/tests/app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/block/mass-converter/widget-directive.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
88
define([
99
'jquery',
10+
'Magento_PageBuilder/js/unit/object-assign-polyfill',
1011
'Magento_PageBuilder/js/content-type/block/mass-converter/widget-directive'
11-
], function ($, WidgetDirective) {
12+
], function ($, polyfill, WidgetDirective) {
1213
'use strict';
1314

1415
describe('Magento_PageBuilder/js/content-type/block/mass-converter/widget-directive', function () {

dev/tests/js/jasmine/tests/app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/products/mass-converter/widget-directive.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
88
define([
99
'jquery',
10+
'Magento_PageBuilder/js/unit/object-assign-polyfill',
1011
'Magento_PageBuilder/js/content-type/products/mass-converter/widget-directive'
11-
], function ($, WidgetDirective) {
12+
], function ($, polyfill, WidgetDirective) {
1213
'use strict';
1314

1415
describe('Magento_PageBuilder/js/content-type/products/mass-converter/widget-directive', function () {

0 commit comments

Comments
 (0)