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

[ci skip] Adds tests for placeholder system note

parent 6530035f
<script> <script>
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
export default { export default {
name: 'issuePlaceholderNote',
props: { props: {
note: { note: {
type: Object, type: Object,
required: true, required: true,
}, },
}, },
components: {
userAvatarLink,
},
data() { data() {
return { return {
currentUser: window.gl.currentUserData, currentUser: this.$store.getters.getUserData,
}; };
}, },
}; };
...@@ -18,12 +24,11 @@ ...@@ -18,12 +24,11 @@
<li class="note being-posted fade-in-half timeline-entry"> <li class="note being-posted fade-in-half timeline-entry">
<div class="timeline-entry-inner"> <div class="timeline-entry-inner">
<div class="timeline-icon"> <div class="timeline-icon">
<a :href="currentUser.path"> <user-avatar-link
<img :link-href="currentUser.path"
:src="currentUser.avatar_url" :img-src="currentUser.avatar_url"
class="avatar s40" :size="40"
/> />
</a>
</div> </div>
<div <div
:class="{ discussion: !note.individual_note }" :class="{ discussion: !note.individual_note }"
......
<script> <script>
export default { export default {
name: 'placeholderSystemNote',
props: { props: {
note: { note: {
type: Object, 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