Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/vue_shared/components/notes/note_signed_out_widget_spec.js')
-rw-r--r--spec/javascripts/vue_shared/components/notes/note_signed_out_widget_spec.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/javascripts/vue_shared/components/notes/note_signed_out_widget_spec.js b/spec/javascripts/vue_shared/components/notes/note_signed_out_widget_spec.js
new file mode 100644
index 00000000000..413384f3342
--- /dev/null
+++ b/spec/javascripts/vue_shared/components/notes/note_signed_out_widget_spec.js
@@ -0,0 +1,37 @@
+import Vue from 'vue';
+import noteSignedOut from '~/vue_shared/components/notes/note_signed_out_widget.vue';
+import store from '~/notes/stores';
+import { notesDataMock } from '../mock_data';
+
+describe('note_signed_out_widget', () => {
+ let vm;
+
+ beforeEach(() => {
+ const Component = Vue.extend(noteSignedOut);
+ store.dispatch('setNotesData', notesDataMock);
+
+ vm = new Component({
+ store,
+ }).$mount();
+ });
+
+ afterEach(() => {
+ vm.$destroy();
+ });
+
+ it('should render sign in link provided in the store', () => {
+ 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');
+ });
+
+ it('should render information text', () => {
+ expect(vm.$el.textContent.replace(/\s+/g, ' ').trim()).toEqual('Please register or sign in to reply');
+ });
+});