diff --git a/.env b/.env index 315c33e1c..ab4505d80 100644 --- a/.env +++ b/.env @@ -28,3 +28,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false ENABLE_TEAM_TYPE_SETTING=false ENABLE_NEW_EDITOR_PAGES=true BBB_LEARN_MORE_URL='' +ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false diff --git a/.env.development b/.env.development index ace285e48..16723106d 100644 --- a/.env.development +++ b/.env.development @@ -30,3 +30,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false ENABLE_TEAM_TYPE_SETTING=false ENABLE_NEW_EDITOR_PAGES=true BBB_LEARN_MORE_URL='' +ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false diff --git a/.env.test b/.env.test index cef8e39e4..87ef1ed6f 100644 --- a/.env.test +++ b/.env.test @@ -29,3 +29,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false ENABLE_TEAM_TYPE_SETTING=false ENABLE_NEW_EDITOR_PAGES=true BBB_LEARN_MORE_URL='' +ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=true diff --git a/src/studio-header/Header.jsx b/src/studio-header/Header.jsx index 607a75e86..0499f1891 100644 --- a/src/studio-header/Header.jsx +++ b/src/studio-header/Header.jsx @@ -48,9 +48,11 @@ const Header = ({
{intl.formatMessage(messages['header.links.textbooks'])}
-
- {intl.formatMessage(messages['header.links.videoUploads'])} -
+ {process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN === 'true' && ( +
+ {intl.formatMessage(messages['header.links.videoUploads'])} +
+ )} ), }, diff --git a/src/studio-header/Header.test.jsx b/src/studio-header/Header.test.jsx index c1e84086e..c350c76c0 100644 --- a/src/studio-header/Header.test.jsx +++ b/src/studio-header/Header.test.jsx @@ -6,6 +6,7 @@ import { AppContext } from '@edx/frontend-platform/react'; import { Context as ResponsiveContext } from 'react-responsive'; import { cleanup, + fireEvent, render, screen, } from '@testing-library/react'; @@ -104,6 +105,46 @@ describe('
', () => { 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, ( +
+ ), + ); + + 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, ( +
+ ), + ); + + render(component); + fireEvent.click(screen.getByText('Content')); + + expect(screen.queryByText('Video Uploads')).toBeNull(); + }); + afterEach(() => { cleanup(); });