summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes/components/note_signed_out_widget_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/notes/components/note_signed_out_widget_spec.js')
-rw-r--r--spec/javascripts/notes/components/note_signed_out_widget_spec.js20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/javascripts/notes/components/note_signed_out_widget_spec.js b/spec/javascripts/notes/components/note_signed_out_widget_spec.js
index 6cba8053888..e217a2caa73 100644
--- a/spec/javascripts/notes/components/note_signed_out_widget_spec.js
+++ b/spec/javascripts/notes/components/note_signed_out_widget_spec.js
@@ -1,13 +1,15 @@
import Vue from 'vue';
import noteSignedOut from '~/notes/components/note_signed_out_widget.vue';
-import store from '~/notes/stores';
+import createStore from '~/notes/stores';
import { notesDataMock } from '../mock_data';
describe('note_signed_out_widget component', () => {
+ let store;
let vm;
beforeEach(() => {
const Component = Vue.extend(noteSignedOut);
+ store = createStore();
store.dispatch('setNotesData', notesDataMock);
vm = new Component({
@@ -20,18 +22,20 @@ describe('note_signed_out_widget component', () => {
});
it('should render sign in link provided in the store', () => {
- expect(
- vm.$el.querySelector(`a[href="${notesDataMock.newSessionPath}"]`).textContent,
- ).toEqual('sign in');
+ expect(vm.$el.querySelector(`a[href="${notesDataMock.newSessionPath}"]`).textContent).toEqual(
+ 'sign in',
+ );
});
it('should render register link provided in the store', () => {
- expect(
- vm.$el.querySelector(`a[href="${notesDataMock.registerPath}"]`).textContent,
- ).toEqual('register');
+ expect(vm.$el.querySelector(`a[href="${notesDataMock.registerPath}"]`).textContent).toEqual(
+ 'register',
+ );
});
it('should render information text', () => {
- expect(vm.$el.textContent.replace(/\s+/g, ' ').trim()).toEqual('Please register or sign in to reply');
+ expect(vm.$el.textContent.replace(/\s+/g, ' ').trim()).toEqual(
+ 'Please register or sign in to reply',
+ );
});
});