Skip to content

Commit 5be754b

Browse files
author
Mateusz Krzeszowiak
committed
Add failing test and fix it
1 parent 976302d commit 5be754b

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/code/Magento/Customer/view/frontend/web/js/section-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ define(['underscore'], function (_) {
5050
return route.indexOf(section) === 0;
5151
});
5252

53-
return _.union(actions, sections['*']);
53+
return _.union(_.toArray(actions), sections['*']);
5454
},
5555

5656
/**

dev/tests/js/jasmine/tests/app/code/Magento/Customer/frontend/js/section-config.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,21 @@ define(['squire'], function (Squire) {
128128

129129
expect(obj.getAffectedSections('http://localhost.com/path')).toEqual(['all']);
130130
});
131+
132+
it('Ignores capitalization in parts of URL.', function () {
133+
obj['Magento_Customer/js/section-config']({
134+
sections: {
135+
'path': [
136+
'section'
137+
]
138+
},
139+
baseUrls: [
140+
'http://localhost.com/'
141+
]
142+
});
143+
144+
expect(obj.getAffectedSections('http://localhost.com/PaTh')).toEqual(['section']);
145+
});
131146
});
132147

133148
describe('"filterClientSideSections" method', function () {

0 commit comments

Comments
 (0)