summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2017-11-29 10:35:41 +0000
committerPhil Hughes <me@iamphill.com>2017-11-29 10:35:41 +0000
commitebf22493b56e9231b09e4c2192597848b536d34b (patch)
tree92e21ad088127b442777f144e198a4232b8e3630 /spec/javascripts
parenta2fea9288ef0a2d714827ac5b92e7330d3cb2c3f (diff)
downloadgitlab-ce-ebf22493b56e9231b09e4c2192597848b536d34b.tar.gz
Fix item name and namespace text overflow in Projects dropdown
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/projects_dropdown/components/projects_list_item_spec.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/javascripts/projects_dropdown/components/projects_list_item_spec.js b/spec/javascripts/projects_dropdown/components/projects_list_item_spec.js
index 171629fcd6b..edef150dd1e 100644
--- a/spec/javascripts/projects_dropdown/components/projects_list_item_spec.js
+++ b/spec/javascripts/projects_dropdown/components/projects_list_item_spec.js
@@ -50,6 +50,18 @@ describe('ProjectsListItemComponent', () => {
expect(vm.highlightedProjectName).toBe(mockProject.name);
});
});
+
+ describe('truncatedNamespace', () => {
+ it('should truncate project name from namespace string', () => {
+ vm.namespace = 'platform / nokia-3310';
+ expect(vm.truncatedNamespace).toBe('platform');
+ });
+
+ it('should truncate namespace string from the middle if it includes more than two groups in path', () => {
+ vm.namespace = 'platform / hardware / broadcom / Wifi Group / Mobile Chipset / nokia-3310';
+ expect(vm.truncatedNamespace).toBe('platform / ... / Mobile Chipset');
+ });
+ });
});
describe('template', () => {