Commit 7639fb18 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Adds tests for placeholder system note

parent 6530035f
<script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
export default {
name: 'issuePlaceholderNote',
props: {
note: {
type: Object,
required: true,
},
},
components: {
userAvatarLink,
},
data() {
return {
currentUser: window.gl.currentUserData,
currentUser: this.$store.getters.getUserData,
};
},
};
......@@ -18,12 +24,11 @@
<li class="note being-posted fade-in-half timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon">
<a :href="currentUser.path">
<img
:src="currentUser.avatar_url"
class="avatar s40"
<user-avatar-link
:link-href="currentUser.path"
:img-src="currentUser.avatar_url"
:size="40"
/>
</a>
</div>
<div
:class="{ discussion: !note.individual_note }"
......
<script>
export default {
name: 'placeholderSystemNote',
props: {
note: {
type: Object,
......
import Vue from 'vue';
import placeholderNote from '~/notes/components/issue_placeholder_note.vue';
describe('issue placeholder system note component', () => {
let mountComponent;
beforeEach(() => {
const PlaceholderNote = Vue.extend(placeholderNote);
mountComponent = props => new PlaceholderNote({
propsData: {
note: props,
},
}).$mount();
});
describe('user information', () => {
it('should render user avatar with link', () => {
});
});
describe('note content', () => {
it('should render note header information', () => {
});
it('should render note body', () => {
});
it('should render system note placeholder with markdown', () => {
});
it('should render emojis', () => {
});
it('should render slash commands', () => {
});
});
});
import Vue from 'vue';
import placeholderSystemNote from '~/notes/components/issue_placeholder_system_note.vue';
describe('issue placeholder system note component', () => {
let mountComponent;
beforeEach(() => {
const PlaceholderSystemNote = Vue.extend(placeholderSystemNote);
mountComponent = props => new PlaceholderSystemNote({
propsData: {
note: {
body: props,
},
},
}).$mount();
});
it('should render system note placeholder with plain text', () => {
const vm = mountComponent('This is a placeholder');
expect(vm.$el.tagName).toEqua('LI');
expect(vm.$el.querySelector('.timeline-content i').textContent.trim()).toEqua('This is a placeholder');
});
});
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