diff --git a/frontend/src/components/Contributions/ContributionListItem.spec.js b/frontend/src/components/Contributions/ContributionListItem.spec.js index 57e630a49..52f158f89 100644 --- a/frontend/src/components/Contributions/ContributionListItem.spec.js +++ b/frontend/src/components/Contributions/ContributionListItem.spec.js @@ -132,7 +132,7 @@ describe('ContributionListItem', () => { }) it('opens the modal', () => { - expect(spy).toBeCalledWith('Delete Contribution! Are you sure?') + expect(spy).toBeCalledWith('contribution.delete') }) it('emits delete contribution', () => { diff --git a/frontend/src/components/Contributions/ContributionListItem.vue b/frontend/src/components/Contributions/ContributionListItem.vue index ad1d0bf98..e19153d10 100644 --- a/frontend/src/components/Contributions/ContributionListItem.vue +++ b/frontend/src/components/Contributions/ContributionListItem.vue @@ -26,14 +26,7 @@ > -
+
@@ -101,13 +94,15 @@ export default { }, }, methods: { - deleteContribution(id) { - this.boxOne = '' - this.$bvModal.msgBoxConfirm(this.$t('contribution.delete')).then((value) => { - this.$emit('delete-contribution', { - id: id, + deleteContribution(item) { + this.$bvModal + .msgBoxConfirm(this.$t('contribution.delete')) + .then((value) => { + this.$emit('delete-contribution', item) + }) + .catch((_err) => { + // An error occurred }) - }) }, }, } diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js index e8e7a093c..917fa0222 100644 --- a/frontend/src/pages/Community.spec.js +++ b/frontend/src/pages/Community.spec.js @@ -170,9 +170,7 @@ describe('Community', () => { }) it('toasts a success message', () => { - expect(toastSuccessSpy).toBeCalledWith({ - createContribution: true, - }) + expect(toastSuccessSpy).toBeCalledWith('contribution.submitted') }) it('updates the contribution list', () => { @@ -252,9 +250,7 @@ describe('Community', () => { }) it('toasts a success message', () => { - expect(toastSuccessSpy).toBeCalledWith({ - updateContribution: true, - }) + expect(toastSuccessSpy).toBeCalledWith('contribution.updated') }) it('updates the contribution list', () => { @@ -324,9 +320,7 @@ describe('Community', () => { }) it('toasts a success message', () => { - expect(toastSuccessSpy).toBeCalledWith({ - deleteContribution: true, - }) + expect(toastSuccessSpy).toBeCalledWith('contribution.deleted') }) it('updates the contribution list', () => { diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue index cbf4d21af..21a741e8b 100644 --- a/frontend/src/pages/Community.vue +++ b/frontend/src/pages/Community.vue @@ -155,7 +155,6 @@ export default { }) }, deleteContribution(data) { - alert('deleteContribution') this.$apollo .mutate({ fetchPolicy: 'no-cache',