@@ -14,17 +14,17 @@ import { ScriptDataService } from './core/data/processes/script-data.service';
1414import { NgbModal } from '@ng-bootstrap/ng-bootstrap' ;
1515import { MenuServiceStub } from './shared/testing/menu-service.stub' ;
1616import { MenuID } from './shared/menu/menu-id.model' ;
17- import { BrowseService } from './core/browse/browse.service' ;
1817import { cold } from 'jasmine-marbles' ;
19- import createSpy = jasmine . createSpy ;
2018import { createSuccessfulRemoteDataObject$ } from './shared/remote-data.utils' ;
2119import { createPaginatedList } from './shared/testing/utils.test' ;
20+ import { SectionDataService } from './core/layout/section-data.service' ;
21+ import createSpy = jasmine . createSpy ;
2222
2323const BOOLEAN = { t : true , f : false } ;
2424const MENU_STATE = {
2525 id : 'some menu'
2626} ;
27- const BROWSE_DEFINITIONS = [
27+ const EXPLORE_SECTIONS_DEFINITIONS = [
2828 { id : 'definition1' } ,
2929 { id : 'definition2' } ,
3030 { id : 'definition3' } ,
@@ -34,16 +34,16 @@ describe('MenuResolver', () => {
3434 let resolver : MenuResolver ;
3535
3636 let menuService ;
37- let browseService ;
37+ let sectionsService ;
3838 let authorizationService ;
3939 let scriptService ;
4040
4141 beforeEach ( waitForAsync ( ( ) => {
4242 menuService = new MenuServiceStub ( ) ;
4343 spyOn ( menuService , 'getMenu' ) . and . returnValue ( observableOf ( MENU_STATE ) ) ;
4444
45- browseService = jasmine . createSpyObj ( 'browseService ' , {
46- getBrowseDefinitions : createSuccessfulRemoteDataObject$ ( createPaginatedList ( BROWSE_DEFINITIONS ) )
45+ sectionsService = jasmine . createSpyObj ( 'SectionDataService ' , {
46+ findVisibleSections : createSuccessfulRemoteDataObject$ ( createPaginatedList ( EXPLORE_SECTIONS_DEFINITIONS ) )
4747 } ) ;
4848 authorizationService = jasmine . createSpyObj ( 'authorizationService' , {
4949 isAuthorized : observableOf ( true )
@@ -57,7 +57,7 @@ describe('MenuResolver', () => {
5757 declarations : [ AdminSidebarComponent ] ,
5858 providers : [
5959 { provide : MenuService , useValue : menuService } ,
60- { provide : BrowseService , useValue : browseService } ,
60+ { provide : SectionDataService , useValue : sectionsService } ,
6161 { provide : AuthorizationDataService , useValue : authorizationService } ,
6262 { provide : ScriptDataService , useValue : scriptService } ,
6363 {
@@ -123,19 +123,15 @@ describe('MenuResolver', () => {
123123 } ) ) ;
124124 } ) ;
125125
126- it ( 'should include browse dropdown ' , ( ) => {
126+ it ( 'should include explore sections ' , ( ) => {
127127 expect ( menuService . addSection ) . toHaveBeenCalledWith ( MenuID . PUBLIC , jasmine . objectContaining ( {
128- id : 'browse_global_by_definition1' , parentID : 'browse_global ', visible : true ,
128+ id : 'explore_definition1 ' , visible : true ,
129129 } ) ) ;
130130 expect ( menuService . addSection ) . toHaveBeenCalledWith ( MenuID . PUBLIC , jasmine . objectContaining ( {
131- id : 'browse_global_by_definition2' , parentID : 'browse_global ', visible : true ,
131+ id : 'explore_definition2 ' , visible : true ,
132132 } ) ) ;
133133 expect ( menuService . addSection ) . toHaveBeenCalledWith ( MenuID . PUBLIC , jasmine . objectContaining ( {
134- id : 'browse_global_by_definition3' , parentID : 'browse_global' , visible : true ,
135- } ) ) ;
136-
137- expect ( menuService . addSection ) . toHaveBeenCalledWith ( MenuID . PUBLIC , jasmine . objectContaining ( {
138- id : 'browse_global' , visible : true ,
134+ id : 'explore_definition3' , visible : true ,
139135 } ) ) ;
140136 } ) ;
141137 } ) ;
0 commit comments