@@ -54,6 +54,7 @@ const mockMenuID = 'mock-menuID' as MenuID;
5454 // eslint-disable-next-line @angular-eslint/component-selector
5555 selector : '' ,
5656 template : '' ,
57+ standalone : true ,
5758} )
5859@rendersSectionForMenu ( mockMenuID , true )
5960class TestExpandableMenuComponent {
@@ -63,6 +64,7 @@ class TestExpandableMenuComponent {
6364 // eslint-disable-next-line @angular-eslint/component-selector
6465 selector : '' ,
6566 template : '' ,
67+ standalone : true ,
6668} )
6769@rendersSectionForMenu ( mockMenuID , false )
6870class TestMenuComponent {
@@ -85,8 +87,6 @@ describe('MenuComponent', () => {
8587 visible : true ,
8688 } ;
8789
88- const mockMenuID = 'mock-menuID' as MenuID ;
89-
9090 const mockStatisticSection = { 'id' : 'statistics_site' , 'active' : true , 'visible' : true , 'index' : 2 , 'type' : 'statistics' , 'model' : { 'type' : 1 , 'text' : 'menu.section.statistics' , 'link' : 'statistics' } } ;
9191
9292 let authorizationService : AuthorizationDataService ;
@@ -144,16 +144,14 @@ describe('MenuComponent', () => {
144144 } ) ;
145145
146146 TestBed . configureTestingModule ( {
147- imports : [ TranslateModule . forRoot ( ) , NoopAnimationsModule , RouterTestingModule , MenuComponent , StoreModule . forRoot ( authReducer , storeModuleConfig ) ] ,
147+ imports : [ TranslateModule . forRoot ( ) , NoopAnimationsModule , RouterTestingModule , MenuComponent , StoreModule . forRoot ( authReducer , storeModuleConfig ) , TestExpandableMenuComponent , TestMenuComponent ] ,
148148 providers : [
149149 Injector ,
150150 { provide : ThemeService , useValue : getMockThemeService ( ) } ,
151151 MenuService ,
152152 provideMockStore ( { initialState } ) ,
153153 { provide : AuthorizationDataService , useValue : authorizationService } ,
154154 { provide : ActivatedRoute , useValue : routeStub } ,
155- TestExpandableMenuComponent ,
156- TestMenuComponent ,
157155 ] ,
158156 schemas : [ NO_ERRORS_SCHEMA ] ,
159157 } ) . overrideComponent ( MenuComponent , {
@@ -272,35 +270,4 @@ describe('MenuComponent', () => {
272270 expect ( menuService . collapseMenuPreview ) . toHaveBeenCalledWith ( comp . menuID ) ;
273271 } ) ) ;
274272 } ) ;
275-
276- describe ( 'when unauthorized statistics' , ( ) => {
277-
278- beforeEach ( ( ) => {
279- ( authorizationService as any ) . isAuthorized . and . returnValue ( observableOf ( false ) ) ;
280- fixture . detectChanges ( ) ;
281- } ) ;
282-
283- it ( 'should return observable of empty object' , done => {
284- comp . getAuthorizedStatistics ( mockStatisticSection ) . subscribe ( ( res ) => {
285- expect ( res ) . toEqual ( { } ) ;
286- done ( ) ;
287- } ) ;
288- } ) ;
289- } ) ;
290-
291- describe ( 'get authorized statistics' , ( ) => {
292-
293- beforeEach ( ( ) => {
294- ( authorizationService as any ) . isAuthorized . and . returnValue ( observableOf ( true ) ) ;
295- fixture . detectChanges ( ) ;
296- } ) ;
297-
298- it ( 'should return observable of statistics section menu' , done => {
299- comp . getAuthorizedStatistics ( mockStatisticSection ) . subscribe ( ( res ) => {
300- expect ( res ) . toEqual ( mockStatisticSection ) ;
301- done ( ) ;
302- } ) ;
303- } ) ;
304- } ) ;
305-
306273} ) ;
0 commit comments