From 730da2029c79e5fd5471861319fdcb5213d29805 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 20 Dec 2019 00:59:29 +0100 Subject: [PATCH 1/2] Fix imageAspectRatio set to null UpdatePost - we were not setting the form.imageAspectRatio to the value of the post's imageAspectRatio, so when a user updated their post, but did not update their imageAspectRatio it would set it to null --- webapp/components/ContributionForm/ContributionForm.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/components/ContributionForm/ContributionForm.vue b/webapp/components/ContributionForm/ContributionForm.vue index 92000edf2..a8909f16a 100644 --- a/webapp/components/ContributionForm/ContributionForm.vue +++ b/webapp/components/ContributionForm/ContributionForm.vue @@ -169,6 +169,7 @@ export default { ? languageOptions.find(o => this.contribution.language === o.value) : null form.categoryIds = this.categoryIds(this.contribution.categories) + form.imageAspectRatio = this.contribution.imageAspectRatio form.blurImage = this.contribution.imageBlurred } From a33cb1e6fcd7249de50b1943a8a2d953ca574eda Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Fri, 20 Dec 2019 01:14:43 +0100 Subject: [PATCH 2/2] Make tests accurate --- webapp/components/ContributionForm/ContributionForm.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/components/ContributionForm/ContributionForm.spec.js b/webapp/components/ContributionForm/ContributionForm.spec.js index 2f0f2e30d..a52169bd1 100644 --- a/webapp/components/ContributionForm/ContributionForm.spec.js +++ b/webapp/components/ContributionForm/ContributionForm.spec.js @@ -308,6 +308,7 @@ describe('ContributionForm.vue', () => { name: 'Democracy & Politics', }, ], + imageAspectRatio: 1, }, } wrapper = Wrapper() @@ -354,7 +355,7 @@ describe('ContributionForm.vue', () => { categoryIds: ['cat12'], image, imageUpload: null, - imageAspectRatio: null, + imageAspectRatio: 1, }, } })