feat: customize the certificate link in header (#1223)

* feat: customize the certificate link in header

* fix: lint issues

* fix: tests
This commit is contained in:
Muhammad Anas
2024-08-21 19:36:14 +05:00
committed by GitHub
parent 3089d0b993
commit 8ae9dfbd88
7 changed files with 56 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
import { getConfig, setConfig } from '@edx/frontend-platform';
import { getContentMenuItems, getToolsMenuItems } from './utils';
import { getContentMenuItems, getToolsMenuItems, getSettingMenuItems } from './utils';
const props = {
studioBaseUrl: 'UrLSTuiO',
@@ -29,6 +29,25 @@ describe('header utils', () => {
});
});
describe('getSettingsMenuitems', () => {
it('should include certificates option', () => {
setConfig({
...getConfig(),
ENABLE_CERTIFICATE_PAGE: 'true',
});
const actualItems = getSettingMenuItems(props);
expect(actualItems).toHaveLength(6);
});
it('should not include certificates option', () => {
setConfig({
...getConfig(),
ENABLE_CERTIFICATE_PAGE: 'false',
});
const actualItems = getSettingMenuItems(props);
expect(actualItems).toHaveLength(5);
});
});
describe('getToolsMenuItems', () => {
it('should include export tags option', () => {
setConfig({