diff options
author | kushalpandya <kushal@gitlab.com> | 2017-08-02 12:15:30 +0300 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-08-02 12:15:30 +0300 |
commit | 9636da306ce93f4a07020db169881367a78404cd (patch) | |
tree | ef03ce30c96d3d5223eece0b0b6a86b873bff62b /spec/javascripts/groups | |
parent | 018e1bd55f30991c6b51646e15329585d8d703af (diff) |
Use `$mount` for component rendering, remove tests for `props` datatype as unnecessary
Diffstat (limited to 'spec/javascripts/groups')
-rw-r--r-- | spec/javascripts/groups/group_identicon_spec.js | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/spec/javascripts/groups/group_identicon_spec.js b/spec/javascripts/groups/group_identicon_spec.js index d9615646982..66772327503 100644 --- a/spec/javascripts/groups/group_identicon_spec.js +++ b/spec/javascripts/groups/group_identicon_spec.js @@ -9,40 +9,18 @@ const createComponent = () => { const group = store.decorateGroup(group1); return new Component({ - el: document.createElement('div'), propsData: { entityId: group.id, entityName: group.name, }, - }); + }).$mount(); }; describe('GroupIdenticonComponent', () => { let vm; - let el; beforeEach(() => { vm = createComponent(); - el = vm.$el; - }); - - describe('props', () => { - it('should have props with defined data types', (done) => { - const identiconProps = groupIdenticonComponent.props; - const EntityIdTypeClass = identiconProps.entityId.type; - const EntityNameTypeClass = identiconProps.entityName.type; - - Vue.nextTick(() => { - expect(identiconProps.entityId).toBeDefined(); - expect(new EntityIdTypeClass() instanceof Number).toBeTruthy(); - expect(identiconProps.entityId.required).toBeTruthy(); - - expect(identiconProps.entityName).toBeDefined(); - expect(new EntityNameTypeClass() instanceof String).toBeTruthy(); - expect(identiconProps.entityName.required).toBeTruthy(); - done(); - }); - }); }); describe('computed', () => { @@ -74,9 +52,9 @@ describe('GroupIdenticonComponent', () => { describe('template', () => { it('should render identicon', () => { - expect(el.nodeName).toBe('DIV'); - expect(el.classList.contains('identicon')).toBeTruthy(); - expect(el.getAttribute('style').indexOf('background-color') > -1).toBeTruthy(); + expect(vm.$el.nodeName).toBe('DIV'); + expect(vm.$el.classList.contains('identicon')).toBeTruthy(); + expect(vm.$el.getAttribute('style').indexOf('background-color') > -1).toBeTruthy(); }); }); }); |