Commit c15174c0 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Adds tests for placeholder note component

parent 0c1cf679
......@@ -27,7 +27,6 @@ describe('issue_note_form component', () => {
});
describe('keyboard events', () => {
describe('up', () => {
it('should ender edit mode', () => {
......
import Vue from 'vue';
import issuePlaceholderNote from '~/notes/components/issue_placeholder_note.vue';
import store from '~/notes/stores';
import { userDataMock } from '../mock_data';
describe('issue placeholder system note component', () => {
let vm;
beforeEach(() => {
const Component = Vue.extend(issuePlaceholderNote);
store.dispatch('setUserData', userDataMock);
vm = new Component({
store,
propsData: { note: { body: 'Foo' } },
}).$mount();
});
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);
});
});
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}`);
});
it('should render note body', () => {
});
it('should render system note placeholder with markdown', () => {
});
it('should render emojis', () => {
});
it('should render slash commands', () => {
expect(vm.$el.querySelector('.note-text p').textContent.trim()).toEqual('Foo');
});
});
});
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