diff options
author | Phil Hughes <me@iamphill.com> | 2019-01-08 09:31:23 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-01-08 09:31:23 +0000 |
commit | 12edecd002163e7dedff6fcdf10043b7d1967962 (patch) | |
tree | 45bd3c1eee15e911fd43733f1af77a10e4f0fc98 /spec/javascripts/lib | |
parent | 1d2ef4c6557846eb531f4d0e80cf43dea99b037b (diff) | |
download | gitlab-ce-12edecd002163e7dedff6fcdf10043b7d1967962.tar.gz |
Add headers to files in the tree list on merge requests
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54807
Diffstat (limited to 'spec/javascripts/lib')
-rw-r--r-- | spec/javascripts/lib/utils/text_utility_spec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/javascripts/lib/utils/text_utility_spec.js b/spec/javascripts/lib/utils/text_utility_spec.js index 92ebfc38722..0a266b19ea5 100644 --- a/spec/javascripts/lib/utils/text_utility_spec.js +++ b/spec/javascripts/lib/utils/text_utility_spec.js @@ -135,4 +135,20 @@ describe('text_utility', () => { expect(textUtils.getFirstCharacterCapitalized(null)).toEqual(''); }); }); + + describe('truncatePathMiddleToLength', () => { + it('does not truncate text', () => { + expect(textUtils.truncatePathMiddleToLength('app/test', 50)).toEqual('app/test'); + }); + + it('truncates middle of the path', () => { + expect(textUtils.truncatePathMiddleToLength('app/test/diff', 13)).toEqual('app/…/diff'); + }); + + it('truncates multiple times in the middle of the path', () => { + expect(textUtils.truncatePathMiddleToLength('app/test/merge_request/diff', 13)).toEqual( + 'app/…/…/diff', + ); + }); + }); }); |