Skip to content

Commit 64aa4c7

Browse files
Merge remote-tracking branch 'remotes/github/MAGETWO-71835' into EPAM-PR-58
2 parents 43d6b69 + 94b003e commit 64aa4c7

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

app/code/Magento/Ui/view/base/web/js/grid/columns/expandable.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ define([
6767
}
6868
});
6969

70-
return labels.sort();
70+
return labels.sort(
71+
function (labelFirst, labelSecond) {
72+
return labelFirst.toLowerCase().localeCompare(labelSecond.toLowerCase());
73+
}
74+
);
7175
},
7276

7377
/**

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,22 @@ define([
6969
expect(expandable.getLabel).toHaveBeenCalled();
7070
});
7171
});
72+
73+
describe('getLabelsArray method', function () {
74+
it('check if label array sort alphabetically case insensitive', function () {
75+
record['shared_catalog'].push(1, 2, 3);
76+
expandable.options.push({
77+
label: 'Default',
78+
value: '1'
79+
}, {
80+
label: 'Label',
81+
value: '2'
82+
}, {
83+
label: 'default',
84+
value: '3'
85+
});
86+
expect(expandable.getLabelsArray(record)).toEqual(['Default', 'default', 'Label']);
87+
});
88+
});
7289
});
7390
});

0 commit comments

Comments
 (0)