summaryrefslogtreecommitdiff
path: root/spec/frontend/notes/components/note_attachment_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/notes/components/note_attachment_spec.js')
-rw-r--r--spec/frontend/notes/components/note_attachment_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/frontend/notes/components/note_attachment_spec.js b/spec/frontend/notes/components/note_attachment_spec.js
new file mode 100644
index 00000000000..b14a518b622
--- /dev/null
+++ b/spec/frontend/notes/components/note_attachment_spec.js
@@ -0,0 +1,23 @@
+import Vue from 'vue';
+import noteAttachment from '~/notes/components/note_attachment.vue';
+
+describe('issue note attachment', () => {
+ it('should render properly', () => {
+ const props = {
+ attachment: {
+ filename: 'dk.png',
+ image: true,
+ url: '/dk.png',
+ },
+ };
+
+ const Component = Vue.extend(noteAttachment);
+ 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);
+ });
+});