2017-08-16 14:23:59 -04:00
|
|
|
import Vue from 'vue';
|
2017-12-04 11:19:07 -05:00
|
|
|
import noteAttachment from '~/notes/components/note_attachment.vue';
|
2017-08-16 14:23:59 -04:00
|
|
|
|
|
|
|
describe('issue note attachment', () => {
|
|
|
|
it('should render properly', () => {
|
|
|
|
const props = {
|
|
|
|
attachment: {
|
|
|
|
filename: 'dk.png',
|
|
|
|
image: true,
|
|
|
|
url: '/dk.png',
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2017-12-04 11:19:07 -05:00
|
|
|
const Component = Vue.extend(noteAttachment);
|
2017-08-16 14:23:59 -04:00
|
|
|
const vm = new Component({
|
|
|
|
propsData: props,
|
|
|
|
}).$mount();
|
|
|
|
|
|
|
|
expect(vm.$el.classList.contains('note-attachment')).toBeTruthy();
|
|
|
|
expect(vm.$el.querySelector('img').src).toContain(props.attachment.url);
|
|
|
|
expect(vm.$el.querySelector('a').href).toContain(props.attachment.url);
|
|
|
|
});
|
|
|
|
});
|