Skip to content

Commit e1c5c1d

Browse files
authored
Merge pull request #6063 from magento-trigger/MC-30502
[trigger] MC-30502: JSUnit tests incompatible with Node v10 or v12
2 parents 9bc9bd7 + 6bb128b commit e1c5c1d

File tree

5 files changed

+72
-64
lines changed

5 files changed

+72
-64
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/StorefrontForthLevelCategoryTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<deleteData createDataKey="category3" stepKey="deleteCategory3"/>
3535
<deleteData createDataKey="category2" stepKey="deleteCategory2"/>
3636
<deleteData createDataKey="category1" stepKey="deleteCategory1"/>
37+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanInvalidatedCaches">
38+
<argument name="tags" value="full_page"/>
39+
</actionGroup>
3740
</after>
3841
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="amOnStorefrontPage"/>
3942
<moveMouseOver

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonInCheckoutPageTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<description value="Users are able to place order using Paypal Smart Button on Checkout Page, payment action is Sale"/>
1717
<severity value="CRITICAL"/>
1818
<testCaseId value="MC-13690"/>
19+
<skip>
20+
<issueId value="MC-37236"/>
21+
</skip>
1922
<group value="paypalExpress"/>
2023
</annotations>
2124
<before>

app/code/Magento/Paypal/Test/Mftf/Test/StorefrontPaypalSmartButtonWithFranceMerchantCountryTest.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<description value="Users are able to place order using Paypal Smart Button using Euro currency and merchant country is France"/>
1717
<severity value="MAJOR"/>
1818
<testCaseId value="MC-33274"/>
19+
<skip>
20+
<issueId value="MC-37236"/>
21+
</skip>
1922
<group value="paypalExpress"/>
2023
</annotations>
2124
<before>

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/masonry.test.js

Lines changed: 61 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,78 @@
66
/*eslint max-nested-callbacks: 0*/
77
define([
88
'jquery',
9-
'ko',
109
'Magento_Ui/js/grid/masonry'
11-
], function ($, ko, Masonry) {
10+
], function ($, Masonry) {
1211
'use strict';
1312

14-
var Component,
15-
rows,
16-
container = '<div data-id="masonry_grid" id="masonry_grid"><div class="masonry-image-column"></div></div>';
13+
describe('Magento_Ui/js/grid/masonry', function () {
14+
var Component,
15+
rows,
16+
container = '<div data-id="masonry_grid" id="masonry_grid"><div class="masonry-image-column"></div></div>';
1717

18-
beforeEach(function () {
19-
rows = [
20-
{
21-
_rowIndex: 0,
22-
category: {},
23-
'category_id': 695,
24-
'category_name': 'People',
25-
'comp_url': 'https://stock.adobe.com/Rest/Libraries/Watermarked/Download/327515738/2',
26-
'content_type': 'image/jpeg',
27-
'country_name': 'Malaysia',
28-
'creation_date': '2020-03-02 10:41:51',
29-
'creator_id': 208217780,
30-
'creator_name': 'NajmiArif',
31-
height: 3264,
32-
id: 327515738,
33-
'id_field_name': 'id',
34-
'is_downloaded': 0,
35-
'is_licensed_locally': 0,
36-
keywords: [],
37-
'media_type_id': 1,
38-
overlay: '',
39-
path: '',
40-
'premium_level_id': 0,
41-
'thumbnail_240_url': 'https://t4.ftcdn.net/jpg/03/27/51/57/240_F_327515738_n.jpg',
42-
'thumbnail_500_ur': 'https://as2.ftcdn.net/jpg/03/27/51/57/500_F_327515738_n.jpg',
43-
title: 'Neon effect picture of man wearing medical mask for viral or pandemic disease',
44-
width: 4896
45-
}
18+
beforeEach(function () {
19+
rows = [
20+
{
21+
_rowIndex: 0,
22+
category: {},
23+
'category_id': 695,
24+
'category_name': 'People',
25+
'comp_url': 'url',
26+
'content_type': 'image/jpeg',
27+
'country_name': 'Malaysia',
28+
'creation_date': '2020-03-02 10:41:51',
29+
'creator_id': 208217780,
30+
'creator_name': 'NajmiArif',
31+
height: 3264,
32+
id: 327515738,
33+
'id_field_name': 'id',
34+
'is_downloaded': 0,
35+
'is_licensed_locally': 0,
36+
keywords: [],
37+
'media_type_id': 1,
38+
overlay: '',
39+
path: '',
40+
'premium_level_id': 0,
41+
'thumbnail_240_url': 'url',
42+
'thumbnail_500_ur': 'url',
43+
title: 'Neon effect picture of man wearing medical mask for viral or pandemic disease',
44+
width: 4896
45+
}
46+
];
4647

47-
];
48-
49-
$(container).appendTo('body');
50-
51-
Component = new Masonry({
52-
defaults: {
53-
rows: ko.observable()
54-
}
48+
$(document.body).append(container);
49+
Component = new Masonry({
50+
defaults: {
51+
containerId: '#masonry_grid'
52+
}
53+
});
5554
});
5655

57-
});
58-
59-
afterEach(function () {
60-
$('#masonry_grid').remove();
61-
});
56+
afterEach(function () {
57+
Component.clear();
58+
$('#masonry_grid').remove();
59+
});
6260

63-
describe('check initComponent', function () {
64-
it('verify setLayoutstyles called and grid iniztilized', function () {
65-
var setlayoutStyles = spyOn(Component, 'setLayoutStyles');
61+
describe('check initComponent', function () {
62+
it('verify setLayoutstyles called and grid iniztilized', function () {
63+
var setlayoutStyles = spyOn(Component, 'setLayoutStyles');
6664

67-
expect(Component).toBeDefined();
68-
Component.containerId = 'masonry_grid';
69-
Component.initComponent(rows);
70-
Component.rows().forEach(function (image) {
71-
expect(image.styles).toBeDefined();
72-
expect(image.css).toBeDefined();
65+
expect(Component).toBeDefined();
66+
Component.containerId = 'masonry_grid';
67+
Component.initComponent(rows);
68+
Component.rows().forEach(function (image) {
69+
expect(image.styles).toBeDefined();
70+
expect(image.css).toBeDefined();
71+
});
72+
expect(setlayoutStyles).toHaveBeenCalled();
7373
});
74-
expect(setlayoutStyles).toHaveBeenCalled();
75-
});
76-
it('verify events triggered', function () {
77-
var setLayoutStyles = spyOn(Component, 'setLayoutStyles');
74+
it('verify events triggered', function () {
75+
var setLayoutStyles = spyOn(Component, 'setLayoutStyles');
7876

79-
Component.initComponent(rows);
80-
window.dispatchEvent(new Event('resize'));
81-
expect(setLayoutStyles).toHaveBeenCalled();
77+
Component.initComponent(rows);
78+
window.dispatchEvent(new Event('resize'));
79+
expect(setLayoutStyles).toHaveBeenCalled();
80+
});
8281
});
8382
});
8483
});

package.json.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"grunt-contrib-connect": "~1.0.2",
1919
"grunt-contrib-cssmin": "~2.2.1",
2020
"grunt-contrib-imagemin": "~2.0.1",
21-
"grunt-contrib-jasmine": "~1.1.0",
21+
"grunt-contrib-jasmine": "~1.2.0",
2222
"grunt-contrib-less": "~1.4.1",
2323
"grunt-contrib-watch": "~1.0.0",
2424
"grunt-eslint": "~20.1.0",
@@ -39,4 +39,4 @@
3939
"time-grunt": "~1.4.0",
4040
"underscore": "~1.8.0"
4141
}
42-
}
42+
}

0 commit comments

Comments
 (0)