change for test

This commit is contained in:
ogerly 2022-07-22 07:44:45 +02:00
parent a0de1287b8
commit 85a88d685e
4 changed files with 13 additions and 25 deletions

View File

@ -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', () => {

View File

@ -26,14 +26,7 @@
>
<b-icon icon="pencil" class="h2"></b-icon>
</div>
<div
class="pointer"
@click="
$emit('delete-contribution', {
id: id,
})
"
>
<div class="pointer" @click="deleteContribution({ id: id })">
<b-icon icon="trash" class="h2"></b-icon>
</div>
</div>
@ -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
})
})
},
},
}

View File

@ -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', () => {

View File

@ -155,7 +155,6 @@ export default {
})
},
deleteContribution(data) {
alert('deleteContribution')
this.$apollo
.mutate({
fetchPolicy: 'no-cache',