diff --git a/webapp/components/Comment.spec.js b/webapp/components/Comment.spec.js index e899a05e1..6057599a0 100644 --- a/webapp/components/Comment.spec.js +++ b/webapp/components/Comment.spec.js @@ -28,6 +28,9 @@ describe('Comment.vue', () => { $apollo: { mutate: jest.fn().mockResolvedValue(), }, + $filters: { + truncate: a => a, + }, } getters = { 'auth/user': () => { diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue index a20d49cf7..9ff0536ca 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment.vue @@ -60,6 +60,7 @@ export default { }, buttons: { confirm: { + danger: true, icon: 'trash', textIdent: 'delete.submit', callback: this.deleteCommentCallback, diff --git a/webapp/components/Modal.spec.js b/webapp/components/Modal.spec.js index 0e2158e96..35ece0bee 100644 --- a/webapp/components/Modal.spec.js +++ b/webapp/components/Modal.spec.js @@ -1,6 +1,6 @@ import { shallowMount, createLocalVue } from '@vue/test-utils' import Modal from './Modal.vue' -import DeleteModal from './Modal/DeleteModal.vue' +import ConfirmModal from './Modal/ConfirmModal.vue' import DisableModal from './Modal/DisableModal.vue' import ReportModal from './Modal/ReportModal.vue' import Vuex from 'vuex' @@ -60,7 +60,7 @@ describe('Modal.vue', () => { it('initially empty', () => { wrapper = Wrapper() - expect(wrapper.contains(DeleteModal)).toBe(false) + expect(wrapper.contains(ConfirmModal)).toBe(false) expect(wrapper.contains(DisableModal)).toBe(false) expect(wrapper.contains(ReportModal)).toBe(false) }) @@ -75,10 +75,6 @@ describe('Modal.vue', () => { id: 'c456', title: 'some title', }, - callbacks: { - confirm: null, - cancel: null, - }, }, } wrapper = Wrapper() @@ -93,10 +89,6 @@ describe('Modal.vue', () => { type: 'contribution', name: 'some title', id: 'c456', - callbacks: { - confirm: null, - cancel: null, - }, }) }) @@ -117,20 +109,12 @@ describe('Modal.vue', () => { name: 'Author name', }, }, - callbacks: { - confirm: null, - cancel: null, - }, } wrapper = Wrapper() expect(wrapper.find(DisableModal).props()).toEqual({ type: 'comment', name: 'Author name', id: 'c456', - callbacks: { - confirm: null, - cancel: null, - }, }) }) @@ -140,20 +124,12 @@ describe('Modal.vue', () => { resource: { id: 'c456', }, - callbacks: { - confirm: null, - cancel: null, - }, } wrapper = Wrapper() expect(wrapper.find(DisableModal).props()).toEqual({ type: 'comment', name: '', id: 'c456', - callbacks: { - confirm: null, - cancel: null, - }, }) }) }) diff --git a/webapp/components/Modal.vue b/webapp/components/Modal.vue index 946e4de0e..3c83a0922 100644 --- a/webapp/components/Modal.vue +++ b/webapp/components/Modal.vue @@ -22,7 +22,7 @@ :name="name" @close="close" /> -