mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
Continue the menu refactor and cleanup
This commit is contained in:
@@ -15,6 +15,8 @@ import { AuthorizationDataService } from '../../core/data/feature-authorization/
|
||||
import { createSuccessfulRemoteDataObject } from '../remote-data.utils';
|
||||
import { ThemeService } from '../theme-support/theme.service';
|
||||
import { getMockThemeService } from '../mocks/theme-service.mock';
|
||||
import { MenuItemType } from './menu-item-type.model';
|
||||
import { TextMenuItemModel } from './menu-item/models/text.model';
|
||||
|
||||
describe('MenuComponent', () => {
|
||||
let comp: MenuComponent;
|
||||
@@ -22,6 +24,16 @@ describe('MenuComponent', () => {
|
||||
let menuService: MenuService;
|
||||
let router: any;
|
||||
|
||||
const menuSection: MenuSection = {
|
||||
id: 'browse',
|
||||
model: {
|
||||
type: MenuItemType.TEXT,
|
||||
text: 'menu.section.browse_global',
|
||||
} as TextMenuItemModel,
|
||||
icon: 'globe',
|
||||
visible: true,
|
||||
}
|
||||
|
||||
const mockMenuID = 'mock-menuID' as MenuID;
|
||||
|
||||
const mockStatisticSection = { 'id': 'statistics_site', 'active': true, 'visible': true, 'index': 2, 'type': 'statistics', 'model': { 'type': 1, 'text': 'menu.section.statistics', 'link': 'statistics' } };
|
||||
@@ -76,7 +88,7 @@ describe('MenuComponent', () => {
|
||||
comp.menuID = mockMenuID;
|
||||
menuService = (comp as any).menuService;
|
||||
router = TestBed.inject(Router);
|
||||
spyOn(comp as any, 'getSectionDataInjector').and.returnValue(MenuSection);
|
||||
spyOn(comp as any, 'getSectionDataInjector').and.returnValue(menuSection);
|
||||
spyOn(comp as any, 'getSectionComponent').and.returnValue(observableOf({}));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
Reference in New Issue
Block a user