Continue the menu refactor and cleanup

This commit is contained in:
Yana De Pauw
2024-10-16 10:14:24 +02:00
parent 005936b18d
commit 5a7ebd4ba9
51 changed files with 428 additions and 803 deletions

View File

@@ -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();
});