diff --git a/src/containers/LearnerDashboardHeader/__snapshots__/index.test.jsx.snap b/src/containers/LearnerDashboardHeader/__snapshots__/index.test.jsx.snap index 3d0812a..134b1ee 100644 --- a/src/containers/LearnerDashboardHeader/__snapshots__/index.test.jsx.snap +++ b/src/containers/LearnerDashboardHeader/__snapshots__/index.test.jsx.snap @@ -59,6 +59,8 @@ exports[`LearnerDashboardHeader snapshots without collapsed 1`] = ` className="d-flex" > )} diff --git a/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/__snapshots__/index.test.jsx.snap b/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/__snapshots__/index.test.jsx.snap index ebe61d2..f13ad67 100644 --- a/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/__snapshots__/index.test.jsx.snap +++ b/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/__snapshots__/index.test.jsx.snap @@ -18,7 +18,7 @@ exports[`LookingForChallengeWidget snapshots default 1`] = `
); export const LookingForChallengeWidget = () => { const { formatMessage } = useIntl(); + const { courseSearchUrl } = hooks.usePlatformSettingsData(); return ( { {formatMessage(messages.lookingForChallengePrompt)}
- + {formatMessage(messages.findCoursesButton, { arrow: arrowIcon })}
diff --git a/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/index.test.jsx b/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/index.test.jsx index eb64ac9..f3055ae 100644 --- a/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/index.test.jsx +++ b/src/containers/WidgetSidebar/widgets/LookingForChallengeWidget/index.test.jsx @@ -2,6 +2,14 @@ import { shallow } from 'enzyme'; import LookingForChallengeWidget from '.'; +jest.mock('data/redux', () => ({ + hooks: { + usePlatformSettingsData: () => ({ + courseSearchUrl: 'course-search-url', + }), + }, +})); + describe('LookingForChallengeWidget', () => { describe('snapshots', () => { test('default', () => { diff --git a/src/data/services/lms/urls.js b/src/data/services/lms/urls.js index dabef5d..303a78f 100644 --- a/src/data/services/lms/urls.js +++ b/src/data/services/lms/urls.js @@ -3,10 +3,10 @@ import { configuration } from 'config'; const baseUrl = `${configuration.LMS_BASE_URL}`; -const api = `${baseUrl}/api/`; +const api = `${baseUrl}/api`; // const init = `${api}learner_home/mock/init`; // mock endpoint for testing -const init = `${api}learner_home/init`; +const init = `${api}/learner_home/init`; const courseUnenroll = `${baseUrl}/change_enrollment`; const updateEmailSettings = `${api}/change_email_settings`; @@ -15,6 +15,9 @@ const entitlementEnrollment = (uuid) => `${api}/entitlements/v1/entitlements/${u const baseAppUrl = (url) => baseUrl + url; const learningMfeUrl = (url) => configuration.LEARNING_MICROFRONTEND_URL + url; +// static view url +const programsUrl = baseAppUrl('/dashboard/programs'); + export default StrictDict({ api, init, @@ -23,4 +26,5 @@ export default StrictDict({ entitlementEnrollment, baseAppUrl, learningMfeUrl, + programsUrl, });