From a0e5f75f0b2ec04c9ab3bf555aeed05c0068f0cc Mon Sep 17 00:00:00 2001 From: Diana Olarte Date: Wed, 20 Nov 2024 07:54:36 +1100 Subject: [PATCH] fix: apply feedback --- .env | 1 + .env.development | 1 + .env.test | 1 + src/config/index.js | 2 +- src/containers/LearnerDashboardHeader/index.test.jsx | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env b/.env index 40c4e09b..dd38ba31 100644 --- a/.env +++ b/.env @@ -41,3 +41,4 @@ ACCOUNT_PROFILE_URL='' ENABLE_NOTICES='' CAREER_LINK_URL='' ENABLE_EDX_PERSONAL_DASHBOARD=false +ENABLE_PROGRAMS=false diff --git a/.env.development b/.env.development index 55cfa710..6685c05a 100644 --- a/.env.development +++ b/.env.development @@ -47,3 +47,4 @@ ACCOUNT_PROFILE_URL='http://localhost:1995' ENABLE_NOTICES='' CAREER_LINK_URL='' ENABLE_EDX_PERSONAL_DASHBOARD=false +ENABLE_PROGRAMS=false diff --git a/.env.test b/.env.test index e66d42c8..0769651a 100644 --- a/.env.test +++ b/.env.test @@ -46,3 +46,4 @@ ACCOUNT_PROFILE_URL='http://account-profile-url.test' ENABLE_NOTICES='' CAREER_LINK_URL='' ENABLE_EDX_PERSONAL_DASHBOARD=true +ENABLE_PROGRAMS=false diff --git a/src/config/index.js b/src/config/index.js index cdc867e7..e1bacea8 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -19,7 +19,7 @@ const configuration = { LOGO_URL: process.env.LOGO_URL, ENABLE_EDX_PERSONAL_DASHBOARD: process.env.ENABLE_EDX_PERSONAL_DASHBOARD === 'true', SEARCH_CATALOG_URL: process.env.SEARCH_CATALOG_URL || null, - ENABLE_PROGRAMS: !!process.env.ENABLE_PROGRAMS, + ENABLE_PROGRAMS: process.env.ENABLE_PROGRAMS === 'true', }; const features = {}; diff --git a/src/containers/LearnerDashboardHeader/index.test.jsx b/src/containers/LearnerDashboardHeader/index.test.jsx index 46384f6d..86eb1acf 100644 --- a/src/containers/LearnerDashboardHeader/index.test.jsx +++ b/src/containers/LearnerDashboardHeader/index.test.jsx @@ -39,7 +39,7 @@ describe('LearnerDashboardHeader', () => { const wrapper = shallow(); expect(wrapper.instance.findByType(Header)[0].props.secondaryMenuItems.length).toBe(1); }); - test('should display Programs link if the service is configured in the backend', () => { + test('should display Programs link if it is enabled by configuration', () => { mergeConfig({ ENABLE_PROGRAMS: true }); const wrapper = shallow(); expect(wrapper.instance.findByType(Header)[0].props.mainMenuItems.length).toBe(3);