11import { ComponentFixture , TestBed , waitForAsync } from '@angular/core/testing' ;
2- import { SortDirection , SortOptions } from '../../core/cache/models/sort-options.model' ;
32import { ConfigurationDataService } from '../../core/data/configuration-data.service' ;
43import { RemoteData } from '../../core/data/remote-data' ;
54import { GroupDataService } from '../../core/eperson/group-data.service' ;
@@ -23,7 +22,6 @@ import { RouterMock } from '../mocks/router.mock';
2322
2423describe ( 'RssComponent' , ( ) => {
2524 let comp : RSSComponent ;
26- let options : SortOptions ;
2725 let fixture : ComponentFixture < RSSComponent > ;
2826 let uuid : string ;
2927 let query : string ;
@@ -63,7 +61,6 @@ describe('RssComponent', () => {
6361 pageSize : 10 ,
6462 currentPage : 1
6563 } ) ,
66- sort : new SortOptions ( 'dc.title' , SortDirection . ASC ) ,
6764 } ) ) ;
6865 groupDataService = jasmine . createSpyObj ( 'groupsDataService' , {
6966 findListByHref : createSuccessfulRemoteDataObject$ ( createPaginatedList ( [ ] ) ) ,
@@ -88,26 +85,25 @@ describe('RssComponent', () => {
8885 } ) ) ;
8986
9087 beforeEach ( ( ) => {
91- options = new SortOptions ( 'dc.title' , SortDirection . DESC ) ;
9288 uuid = '2cfcf65e-0a51-4bcb-8592-b8db7b064790' ;
9389 query = 'test' ;
9490 fixture = TestBed . createComponent ( RSSComponent ) ;
9591 comp = fixture . componentInstance ;
9692 } ) ;
9793
9894 it ( 'should formulate the correct url given params in url' , ( ) => {
99- const route = comp . formulateRoute ( uuid , 'opensearch/search' , options , query ) ;
100- expect ( route ) . toBe ( '/opensearch/search?format=atom&scope=2cfcf65e-0a51-4bcb-8592-b8db7b064790&sort=dc.title&sort_direction=DESC& query=test' ) ;
95+ const route = comp . formulateRoute ( uuid , 'opensearch/search' , query ) ;
96+ expect ( route ) . toBe ( '/opensearch/search?format=atom&scope=2cfcf65e-0a51-4bcb-8592-b8db7b064790&query=test' ) ;
10197 } ) ;
10298
10399 it ( 'should skip uuid if its null' , ( ) => {
104- const route = comp . formulateRoute ( null , 'opensearch/search' , options , query ) ;
105- expect ( route ) . toBe ( '/opensearch/search?format=atom&sort=dc.title&sort_direction=DESC& query=test' ) ;
100+ const route = comp . formulateRoute ( null , 'opensearch/search' , query ) ;
101+ expect ( route ) . toBe ( '/opensearch/search?format=atom&query=test' ) ;
106102 } ) ;
107103
108104 it ( 'should default to query * if none provided' , ( ) => {
109- const route = comp . formulateRoute ( null , 'opensearch/search' , options , null ) ;
110- expect ( route ) . toBe ( '/opensearch/search?format=atom&sort=dc.title&sort_direction=DESC& query=*' ) ;
105+ const route = comp . formulateRoute ( null , 'opensearch/search' , null ) ;
106+ expect ( route ) . toBe ( '/opensearch/search?format=atom&query=*' ) ;
111107 } ) ;
112108} ) ;
113109
0 commit comments