diff options
| author | kushalpandya <kushal@gitlab.com> | 2017-08-30 11:21:43 +0530 |
|---|---|---|
| committer | kushalpandya <kushal@gitlab.com> | 2017-08-30 11:21:43 +0530 |
| commit | ee0fae8eaf81b267f487abd4bd9c6dc8b704449f (patch) | |
| tree | 4261624187377a8914fe3f2e754fc20e320e7dba /spec/javascripts/groups | |
| parent | 499b640679c0dca5b5d93da945da0ca26db8e58e (diff) | |
| download | gitlab-ce-ee0fae8eaf81b267f487abd4bd9c6dc8b704449f.tar.gz | |
Renamed to `identicon` and make shared component
Diffstat (limited to 'spec/javascripts/groups')
| -rw-r--r-- | spec/javascripts/groups/group_identicon_spec.js | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/spec/javascripts/groups/group_identicon_spec.js b/spec/javascripts/groups/group_identicon_spec.js deleted file mode 100644 index 66772327503..00000000000 --- a/spec/javascripts/groups/group_identicon_spec.js +++ /dev/null @@ -1,60 +0,0 @@ -import Vue from 'vue'; -import groupIdenticonComponent from '~/groups/components/group_identicon.vue'; -import GroupsStore from '~/groups/stores/groups_store'; -import { group1 } from './mock_data'; - -const createComponent = () => { - const Component = Vue.extend(groupIdenticonComponent); - const store = new GroupsStore(); - const group = store.decorateGroup(group1); - - return new Component({ - propsData: { - entityId: group.id, - entityName: group.name, - }, - }).$mount(); -}; - -describe('GroupIdenticonComponent', () => { - let vm; - - beforeEach(() => { - vm = createComponent(); - }); - - describe('computed', () => { - describe('identiconStyles', () => { - it('should return styles attribute value with `background-color` property', () => { - vm.entityId = 4; - - expect(vm.identiconStyles).toBeDefined(); - expect(vm.identiconStyles.indexOf('background-color: #E0F2F1;') > -1).toBeTruthy(); - }); - - it('should return styles attribute value with `color` property', () => { - vm.entityId = 4; - - expect(vm.identiconStyles).toBeDefined(); - expect(vm.identiconStyles.indexOf('color: #555;') > -1).toBeTruthy(); - }); - }); - - describe('identiconTitle', () => { - it('should return first letter of entity title in uppercase', () => { - vm.entityName = 'dummy-group'; - - expect(vm.identiconTitle).toBeDefined(); - expect(vm.identiconTitle).toBe('D'); - }); - }); - }); - - describe('template', () => { - it('should render identicon', () => { - expect(vm.$el.nodeName).toBe('DIV'); - expect(vm.$el.classList.contains('identicon')).toBeTruthy(); - expect(vm.$el.getAttribute('style').indexOf('background-color') > -1).toBeTruthy(); - }); - }); -}); |
