Compare commits
1 Commits
open-relea
...
open-relea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
601cf8da66 |
1
.env
1
.env
@@ -27,3 +27,4 @@ USER_INFO_COOKIE_NAME=''
|
||||
ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
||||
ENABLE_TEAM_TYPE_SETTING=false
|
||||
ENABLE_NEW_EDITOR_PAGES=true
|
||||
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false
|
||||
|
||||
@@ -29,3 +29,4 @@ USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
||||
ENABLE_TEAM_TYPE_SETTING=false
|
||||
ENABLE_NEW_EDITOR_PAGES=true
|
||||
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false
|
||||
|
||||
@@ -28,3 +28,4 @@ USER_INFO_COOKIE_NAME='edx-user-info'
|
||||
ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
||||
ENABLE_TEAM_TYPE_SETTING=false
|
||||
ENABLE_NEW_EDITOR_PAGES=true
|
||||
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=true
|
||||
|
||||
@@ -48,9 +48,11 @@ function Header({
|
||||
<div className="mb-1 small">
|
||||
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/textbooks/${courseId}`}>{intl.formatMessage(messages['header.links.textbooks'])}</a>
|
||||
</div>
|
||||
<div className="mb-1 small">
|
||||
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/videos/${courseId}`}>{intl.formatMessage(messages['header.links.videoUploads'])}</a>
|
||||
</div>
|
||||
{process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN === 'true' && (
|
||||
<div className="mb-1 small">
|
||||
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/videos/${courseId}`}>{intl.formatMessage(messages['header.links.videoUploads'])}</a>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -5,6 +5,7 @@ import { AppContext } from '@edx/frontend-platform/react';
|
||||
import { Context as ResponsiveContext } from 'react-responsive';
|
||||
import {
|
||||
cleanup,
|
||||
fireEvent,
|
||||
render,
|
||||
screen,
|
||||
} from '@testing-library/react';
|
||||
@@ -95,6 +96,46 @@ describe('<Header />', () => {
|
||||
expect(screen.getByTestId('edx-header-logo'));
|
||||
});
|
||||
|
||||
it('renders Video Uploads link', () => {
|
||||
process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN = 'true';
|
||||
|
||||
const component = createComponent(
|
||||
1280, (
|
||||
<Header
|
||||
courseId="course-v1:edX+DemoX+Demo_Course"
|
||||
courseNumber="DemoX"
|
||||
courseOrg="edX"
|
||||
courseTitle="Demonstration Course"
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
render(component);
|
||||
fireEvent.click(screen.getByText('Content'));
|
||||
|
||||
expect(screen.getByText('Video Uploads')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not render Video Uploads link', () => {
|
||||
process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN = 'false';
|
||||
|
||||
const component = createComponent(
|
||||
1280, (
|
||||
<Header
|
||||
courseId="course-v1:edX+DemoX+Demo_Course"
|
||||
courseNumber="DemoX"
|
||||
courseOrg="edX"
|
||||
courseTitle="Demonstration Course"
|
||||
/>
|
||||
),
|
||||
);
|
||||
|
||||
render(component);
|
||||
fireEvent.click(screen.getByText('Content'));
|
||||
|
||||
expect(screen.queryByText('Video Uploads')).toBeNull();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
cleanup();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user