Skip to content

Commit fe658c1

Browse files
fix: added LMS_BASE_URL for brand logo (#498)
1 parent 82dbc27 commit fe658c1

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/containers/LearnerDashboardHeader/BrandLogo.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import React from 'react';
2-
31
import { useIntl } from '@edx/frontend-platform/i18n';
42

53
import { reduxHooks } from 'hooks';
@@ -12,7 +10,7 @@ export const BrandLogo = () => {
1210
const dashboard = reduxHooks.useEnterpriseDashboardData();
1311

1412
return (
15-
<a href={dashboard?.url || '/'} className="mx-auto">
13+
<a href={dashboard?.url || getConfig().LMS_BASE_URL} className="mx-auto">
1614
<img
1715
className="logo py-3"
1816
src={getConfig().LOGO_URL}

src/containers/LearnerDashboardHeader/BrandLogo.test.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { shallow } from '@edx/react-unit-test-utils';
2-
2+
import { getConfig } from '@edx/frontend-platform';
33
import { reduxHooks } from 'hooks';
4+
45
import BrandLogo from './BrandLogo';
56

67
jest.mock('hooks', () => ({
@@ -23,6 +24,6 @@ describe('BrandLogo', () => {
2324
reduxHooks.useEnterpriseDashboardData.mockReturnValueOnce(null);
2425
const wrapper = shallow(<BrandLogo />);
2526
expect(wrapper.snapshot).toMatchSnapshot();
26-
expect(wrapper.instance.findByType('a')[0].props.href).toEqual('/');
27+
expect(wrapper.instance.findByType('a')[0].props.href).toEqual(getConfig().LMS_BASE_URL);
2728
});
2829
});

src/containers/LearnerDashboardHeader/__snapshots__/BrandLogo.test.jsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exports[`BrandLogo dashboard defined 1`] = `
1616
exports[`BrandLogo dashboard undefined 1`] = `
1717
<a
1818
className="mx-auto"
19-
href="/"
19+
href="http://localhost:18000"
2020
>
2121
<img
2222
alt="edX, Inc. Dashboard"

0 commit comments

Comments
 (0)