Skip to content

Commit

Permalink
Add failing test and fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Krzeszowiak committed Jan 31, 2020
1 parent 976302d commit 5be754b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ define(['underscore'], function (_) {
return route.indexOf(section) === 0;
});

return _.union(actions, sections['*']);
return _.union(_.toArray(actions), sections['*']);
},

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ define(['squire'], function (Squire) {

expect(obj.getAffectedSections('http://localhost.com/path')).toEqual(['all']);
});

it('Ignores capitalization in parts of URL.', function () {
obj['Magento_Customer/js/section-config']({
sections: {
'path': [
'section'
]
},
baseUrls: [
'http://localhost.com/'
]
});

expect(obj.getAffectedSections('http://localhost.com/PaTh')).toEqual(['section']);
});
});

describe('"filterClientSideSections" method', function () {
Expand Down

0 comments on commit 5be754b

Please sign in to comment.