summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-08-16 21:23:59 +0300
committerFatih Acet <acetfatih@gmail.com>2017-08-16 21:23:59 +0300
commit5604348fccd6d584f5d890e42766dc911ae2b86b (patch)
treeb8bf81809b4be5827c06209288a67e964c011e25 /spec/javascripts/notes
parent772e560337b3c11c703512b27568ad0fdc3a7bb5 (diff)
downloadgitlab-ce-5604348fccd6d584f5d890e42766dc911ae2b86b.tar.gz
IssueNotesRefactor: Implement missing attachment image.
Diffstat (limited to 'spec/javascripts/notes')
-rw-r--r--spec/javascripts/notes/components/issue_note_attachment_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/javascripts/notes/components/issue_note_attachment_spec.js b/spec/javascripts/notes/components/issue_note_attachment_spec.js
new file mode 100644
index 00000000000..8f33b874ad6
--- /dev/null
+++ b/spec/javascripts/notes/components/issue_note_attachment_spec.js
@@ -0,0 +1,23 @@
+import Vue from 'vue';
+import issueNoteAttachment from '~/notes/components/issue_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(issueNoteAttachment);
+ 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);
+ });
+});