feat: add export course tags menu (#830)
This change adds an item in the Tools menu to export the course tags to a CSV file.
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { getConfig, setConfig } from '@edx/frontend-platform';
|
||||
import { getContentMenuItems } from './utils';
|
||||
import { getContentMenuItems, getToolsMenuItems } from './utils';
|
||||
|
||||
const props = {
|
||||
studioBaseUrl: 'UrLSTuiO',
|
||||
courseId: '123',
|
||||
intl: {
|
||||
formatMessage: jest.fn(),
|
||||
formatMessage: jest.fn(message => message.defaultMessage),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -28,4 +28,32 @@ describe('header utils', () => {
|
||||
expect(actualItems).toHaveLength(4);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getToolsMenuItems', () => {
|
||||
it('should include export tags option', () => {
|
||||
setConfig({
|
||||
...getConfig(),
|
||||
ENABLE_TAGGING_TAXONOMY_PAGES: 'true',
|
||||
});
|
||||
const actualItemsTitle = getToolsMenuItems(props).map((item) => item.title);
|
||||
expect(actualItemsTitle).toEqual([
|
||||
'Import',
|
||||
'Export Course',
|
||||
'Export Tags',
|
||||
'Checklists',
|
||||
]);
|
||||
});
|
||||
it('should not include export tags option', () => {
|
||||
setConfig({
|
||||
...getConfig(),
|
||||
ENABLE_TAGGING_TAXONOMY_PAGES: 'false',
|
||||
});
|
||||
const actualItemsTitle = getToolsMenuItems(props).map((item) => item.title);
|
||||
expect(actualItemsTitle).toEqual([
|
||||
'Import',
|
||||
'Export Course',
|
||||
'Checklists',
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user