diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2018-06-21 12:22:40 +0000 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2018-06-21 12:22:40 +0000 |
commit | 3e66795ef1ff1228906239763910b051d8afcc37 (patch) | |
tree | df6424d9ec008f5d1da455f8465681b371c4a11e /spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js | |
parent | 14e35ac9b19d358d84e0cfd167f74036937285b6 (diff) | |
download | gitlab-ce-3e66795ef1ff1228906239763910b051d8afcc37.tar.gz |
Changes tab VUE refactoring
Diffstat (limited to 'spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js')
-rw-r--r-- | spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js b/spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js index ba8ab0b2cd7..7e57c51bf29 100644 --- a/spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js +++ b/spec/javascripts/vue_shared/components/notes/placeholder_note_spec.js @@ -1,13 +1,15 @@ import Vue from 'vue'; import issuePlaceholderNote from '~/vue_shared/components/notes/placeholder_note.vue'; -import store from '~/notes/stores'; +import createStore from '~/notes/stores'; import { userDataMock } from '../../../notes/mock_data'; describe('issue placeholder system note component', () => { + let store; let vm; beforeEach(() => { const Component = Vue.extend(issuePlaceholderNote); + store = createStore(); store.dispatch('setUserData', userDataMock); vm = new Component({ store, @@ -21,15 +23,23 @@ describe('issue placeholder system note component', () => { describe('user information', () => { it('should render user avatar with link', () => { - expect(vm.$el.querySelector('.user-avatar-link').getAttribute('href')).toEqual(userDataMock.path); - expect(vm.$el.querySelector('.user-avatar-link img').getAttribute('src')).toEqual(userDataMock.avatar_url); + expect(vm.$el.querySelector('.user-avatar-link').getAttribute('href')).toEqual( + userDataMock.path, + ); + expect(vm.$el.querySelector('.user-avatar-link img').getAttribute('src')).toEqual( + userDataMock.avatar_url, + ); }); }); describe('note content', () => { it('should render note header information', () => { - expect(vm.$el.querySelector('.note-header-info a').getAttribute('href')).toEqual(userDataMock.path); - expect(vm.$el.querySelector('.note-header-info .note-headline-light').textContent.trim()).toEqual(`@${userDataMock.username}`); + expect(vm.$el.querySelector('.note-header-info a').getAttribute('href')).toEqual( + userDataMock.path, + ); + expect( + vm.$el.querySelector('.note-header-info .note-headline-light').textContent.trim(), + ).toEqual(`@${userDataMock.username}`); }); it('should render note body', () => { |