mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fix: spec, delete teasureImage
This commit is contained in:
parent
6dd248fa4a
commit
a8132d23da
@ -235,6 +235,12 @@ describe('ContributionForm.vue', () => {
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expect.objectContaining(expectedParams))
|
||||
})
|
||||
|
||||
it('deleted a teaser image', async () => {
|
||||
expectedParams.variables.imageUpload = imageUpload
|
||||
wrapper.find(TeaserImage).vm.$emit('addTeaserImage', imageUpload)
|
||||
wrapper.find(TeaserImage).vm.$emit('deleteImage', null)
|
||||
})
|
||||
|
||||
it('content is valid with just a link', async () => {
|
||||
await wrapper.vm.updateEditorContent(
|
||||
'<a href="https://www.youtube.com/watch?v=smoEelV6FUk" target="_blank"></a>',
|
||||
|
||||
@ -71,9 +71,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
deleteImage() {
|
||||
this.clearImages()
|
||||
},
|
||||
template() {
|
||||
return `<div class="dz-preview dz-file-preview">
|
||||
<div class="dz-image">
|
||||
@ -105,6 +102,9 @@ export default {
|
||||
this.oldImage = contributionImage
|
||||
if (contributionImage) contributionImage.remove()
|
||||
},
|
||||
deleteImage() {
|
||||
this.clearImages()
|
||||
},
|
||||
initCropper() {
|
||||
this.image = new Image()
|
||||
this.image.src = URL.createObjectURL(this.file)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user