summaryrefslogtreecommitdiff
path: root/spec/frontend/lib/utils/url_utility_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/url_utility_spec.js')
-rw-r--r--spec/frontend/lib/utils/url_utility_spec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/url_utility_spec.js b/spec/frontend/lib/utils/url_utility_spec.js
index 2c6b603197d..6afdab455a6 100644
--- a/spec/frontend/lib/utils/url_utility_spec.js
+++ b/spec/frontend/lib/utils/url_utility_spec.js
@@ -759,6 +759,19 @@ describe('URL utility', () => {
});
});
+ describe('cleanEndingSeparator', () => {
+ it.each`
+ path | expected
+ ${'foo/bar'} | ${'foo/bar'}
+ ${'/foo/bar/'} | ${'/foo/bar'}
+ ${'foo/bar//'} | ${'foo/bar'}
+ ${'foo/bar/./'} | ${'foo/bar/.'}
+ ${''} | ${''}
+ `('$path becomes $expected', ({ path, expected }) => {
+ expect(urlUtils.cleanEndingSeparator(path)).toBe(expected);
+ });
+ });
+
describe('joinPaths', () => {
it.each`
paths | expected