fix: added LMS_BASE_URL for brand logo (#498)

This commit is contained in:
Peter Kulko
2024-11-20 13:19:08 +02:00
committed by GitHub
parent 82dbc27aba
commit fe658c1796
3 changed files with 5 additions and 6 deletions

View File

@@ -1,5 +1,3 @@
import React from 'react';
import { useIntl } from '@edx/frontend-platform/i18n';
import { reduxHooks } from 'hooks';
@@ -12,7 +10,7 @@ export const BrandLogo = () => {
const dashboard = reduxHooks.useEnterpriseDashboardData();
return (
<a href={dashboard?.url || '/'} className="mx-auto">
<a href={dashboard?.url || getConfig().LMS_BASE_URL} className="mx-auto">
<img
className="logo py-3"
src={getConfig().LOGO_URL}

View File

@@ -1,6 +1,7 @@
import { shallow } from '@edx/react-unit-test-utils';
import { getConfig } from '@edx/frontend-platform';
import { reduxHooks } from 'hooks';
import BrandLogo from './BrandLogo';
jest.mock('hooks', () => ({
@@ -23,6 +24,6 @@ describe('BrandLogo', () => {
reduxHooks.useEnterpriseDashboardData.mockReturnValueOnce(null);
const wrapper = shallow(<BrandLogo />);
expect(wrapper.snapshot).toMatchSnapshot();
expect(wrapper.instance.findByType('a')[0].props.href).toEqual('/');
expect(wrapper.instance.findByType('a')[0].props.href).toEqual(getConfig().LMS_BASE_URL);
});
});

View File

@@ -16,7 +16,7 @@ exports[`BrandLogo dashboard defined 1`] = `
exports[`BrandLogo dashboard undefined 1`] = `
<a
className="mx-auto"
href="/"
href="http://localhost:18000"
>
<img
alt="edX, Inc. Dashboard"