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', () => { ...@@ -27,7 +27,6 @@ describe('issue_note_form component', () => {
}); });
describe('keyboard events', () => { describe('keyboard events', () => {
describe('up', () => { describe('up', () => {
it('should ender edit mode', () => { 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', () => { describe('issue placeholder system note component', () => {
let vm;
beforeEach(() => { beforeEach(() => {
const Component = Vue.extend(issuePlaceholderNote);
store.dispatch('setUserData', userDataMock);
vm = new Component({
store,
propsData: { note: { body: 'Foo' } },
}).$mount();
}); });
describe('user information', () => { describe('user information', () => {
it('should render user avatar with link', () => { 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', () => { describe('note content', () => {
it('should render note header information', () => { 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 note body', () => {
expect(vm.$el.querySelector('.note-text p').textContent.trim()).toEqual('Foo');
});
it('should render system note placeholder with markdown', () => {
});
it('should render emojis', () => {
});
it('should render slash commands', () => {
}); });
}); });
}); });
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