Skip to content

Commit

Permalink
refactor: update price field name for staff check (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
azanbinzahid committed Mar 24, 2022
1 parent e01b3c0 commit 1e89b5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/utils/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
4 changes: 2 additions & 2 deletions src/utils/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -242,7 +242,7 @@ describe('editCourseValidate', () => {
expect(editCourseValidate(values, {
targetRun: unpublishedTargetRun,
registeredFields: {
'prices.executive-education': {
'prices.paid-executive-education': {
count: 1,
},
},
Expand Down

0 comments on commit 1e89b5b

Please sign in to comment.