From 4a17cf0e07f2e18f08f0cab07a485024b8a9fa31 Mon Sep 17 00:00:00 2001 From: Alina Beck Date: Wed, 19 Feb 2020 15:55:10 +0100 Subject: [PATCH] move deleteImage logic to ImageUploader --- .../ContributionForm/ContributionForm.spec.js | 3 +- .../ContributionForm/ContributionForm.vue | 21 ++--- .../ImageUploader/ImageUploader.vue | 85 +++++++------------ 3 files changed, 44 insertions(+), 65 deletions(-) diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js index 8c269cda8..e553118c7 100644 --- a/webapp/components/ContributionForm/ContributionForm.spec.js +++ b/webapp/components/ContributionForm/ContributionForm.spec.js @@ -380,9 +380,10 @@ describe('ContributionForm.vue', () => { it('supports deleting a teaser image', async () => { expectedParams.variables.image = null + expectedParams.variables.imageAspectRatio = null propsData.contribution.image = '/uploads/someimage.png' wrapper = Wrapper() - wrapper.find('.contribution-form .delete-image').trigger('click') + wrapper.find('[data-test="delete-button"]').trigger('click') await wrapper.find('form').trigger('submit') expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expect.objectContaining(expectedParams)) }) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index a6f74fec9..a4f76f3d2 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -11,11 +11,11 @@