diff --git a/.env b/.env index 8bbb8c16d..d7c2acae6 100644 --- a/.env +++ b/.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 diff --git a/.env.development b/.env.development index 3bfeb2543..3d1400ae0 100644 --- a/.env.development +++ b/.env.development @@ -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 diff --git a/.env.test b/.env.test index 91cf00cfe..6d9c5b35b 100644 --- a/.env.test +++ b/.env.test @@ -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 diff --git a/src/studio-header/Header.jsx b/src/studio-header/Header.jsx index b05718ccb..1d5dfef01 100644 --- a/src/studio-header/Header.jsx +++ b/src/studio-header/Header.jsx @@ -48,9 +48,11 @@ function 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 73a09165c..b4afed154 100644 --- a/src/studio-header/Header.test.jsx +++ b/src/studio-header/Header.test.jsx @@ -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('
', () => { 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(); });