From 1e89b5b9cc17320b3f4053716f3c4d51b53b7ab3 Mon Sep 17 00:00:00 2001 From: Azan Bin Zahid <47540683+azanbinzahid@users.noreply.github.com> Date: Thu, 24 Mar 2022 18:50:37 +0500 Subject: [PATCH] refactor: update price field name for staff check (#694) --- src/utils/validation.js | 4 ++-- src/utils/validation.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/validation.js b/src/utils/validation.js index 81dd9b0f3..86bec5855 100644 --- a/src/utils/validation.js +++ b/src/utils/validation.js @@ -100,8 +100,8 @@ const editCourseValidate = (values, props) => { if (isSubmittingRun) { // naive check to deteremine if track is executive education or not const isExecutiveEducation = registeredFields - && registeredFields['prices.executive-education'] - && registeredFields['prices.executive-education'].count; + && registeredFields['prices.paid-executive-education'] + && registeredFields['prices.paid-executive-education'].count; const runRequiredFields = isExecutiveEducation ? ['transcript_languages'] : ['transcript_languages', 'staff']; const runErrors = {}; diff --git a/src/utils/validation.test.js b/src/utils/validation.test.js index 04bf680cf..b3ef173a8 100644 --- a/src/utils/validation.test.js +++ b/src/utils/validation.test.js @@ -218,7 +218,7 @@ describe('editCourseValidate', () => { }; expect(editCourseValidate(values, { targetRun: unpublishedTargetRun })).toEqual(expectedErrors); }); - it('returns no error on submitting executive education course runs with missing staff', () => { + it('returns no error on submitting 2U executive education course runs with missing staff', () => { const values = { short_description: 'Short', full_description: 'Full', @@ -242,7 +242,7 @@ describe('editCourseValidate', () => { expect(editCourseValidate(values, { targetRun: unpublishedTargetRun, registeredFields: { - 'prices.executive-education': { + 'prices.paid-executive-education': { count: 1, }, },