Commit 02c66dad authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Adds unit tests for issue_note_signed_out_widget component

parent 18091353
import Vue from 'vue';
import issueNoteSignedOut from '~/notes/components/issue_note_signed_out_widget.vue';
import store from '~/notes/stores';
import { notesDataMock } from '../mock_data';
describe('issue_note_signed_out_widget component', () => {
it('should render sign in link provided in the store', () => {
let vm;
beforeEach(() => {
const Component = Vue.extend(issueNoteSignedOut);
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');
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment