Skip to content

Commit a246993

Browse files
committed
Correct jasmine tests && fix static tests
1 parent 3757078 commit a246993

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

app/code/Magento/MediaGalleryUi/Model/Directories/GetFolderTree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private function getDirectories(): array
8787

8888
$pathArray = explode('/', $path);
8989
$displayName = strlen(end($pathArray)) > self::NAME_LENGTH ?
90-
substr(end($pathArray),0, self::NAME_LENGTH) . "..." :
90+
substr(end($pathArray), 0 , self::NAME_LENGTH) . "..." :
9191
end($pathArray);
9292
$directories[] = [
9393
'data' => count($pathArray) > 0 ? $displayName : $path,

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/url-filter-applier.test.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55

66
/*eslint max-nested-callbacks: 0*/
77
define([
8-
'Magento_Ui/js/grid/url-filter-applier'
9-
], function (UrlFilterApplier) {
8+
'Magento_Ui/js/grid/url-filter-applier',
9+
'jquery'
10+
], function (UrlFilterApplier, $) {
1011
'use strict';
1112

1213
describe('Magento_Ui/js/grid/url-filter-applier', function () {
1314
var urlFilterApplierObj,
1415
filterComponentMock = {
15-
setData: jasmine.createSpy(),
16+
set: jasmine.createSpy(),
17+
get: jasmine.createSpy(),
1618
apply: jasmine.createSpy()
1719
};
1820

@@ -64,11 +66,14 @@ define([
6466
it('applies url filter on filter component', function () {
6567
urlFilterApplierObj.searchString = '?filters[name]=test&filters[qty]=1';
6668
urlFilterApplierObj.apply();
67-
expect(urlFilterApplierObj.filterComponent().setData).toHaveBeenCalledWith({
68-
'name': 'test',
69-
'qty': '1'
70-
}, false);
71-
expect(urlFilterApplierObj.filterComponent().apply).toHaveBeenCalled();
69+
expect(urlFilterApplierObj.filterComponent().get).toHaveBeenCalled();
70+
expect(urlFilterApplierObj.filterComponent().set).toHaveBeenCalledWith(
71+
'applied',
72+
{
73+
'name': 'test',
74+
'qty': '1'
75+
}
76+
);
7277
});
7378
});
7479
});

0 commit comments

Comments
 (0)