1- import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2-
3- import { LuckySearchComponent } from './lucky-search.component' ;
4- import { LuckySearchService } from '../lucky-search.service' ;
5- import { SearchConfigurationService } from '../../core/shared/search/search-configuration.service' ;
6- import { Router , UrlTree } from '@angular/router' ;
7- import { createSuccessfulRemoteDataObject , createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils' ;
8- import { createPaginatedList } from '../../shared/testing/utils.test' ;
9- import { Item } from '../../core/shared/item.model' ;
10- import { of as observableOf } from 'rxjs' ;
11- import { PaginatedSearchOptions } from '../../shared/search/models/paginated-search-options.model' ;
12- import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model' ;
13- import { SortDirection , SortOptions } from '../../core/cache/models/sort-options.model' ;
14- import { TranslateModule } from '@ngx-translate/core' ;
15- import { By } from '@angular/platform-browser' ;
16- import { SearchResult } from '../../shared/search/models/search-result.model' ;
17- import { DSpaceObject } from '../../core/shared/dspace-object.model' ;
18- import { BitstreamDataService , MetadataFilter } from '../../core/data/bitstream-data.service' ;
19- import { Bitstream } from '../../core/shared/bitstream.model' ;
20- import { RouterMock } from '../../shared/mocks/router.mock' ;
21- import { MetadataMap , MetadataValue } from '../../core/shared/metadata.models' ;
22- import { FileSizePipe } from '../../shared/utils/file-size-pipe' ;
23- import { HardRedirectService } from '../../core/services/hard-redirect.service' ;
24- import { getBitstreamDownloadRoute } from '../../app-routing-paths' ;
25- import { PLATFORM_ID } from '@angular/core' ;
26- import { NotificationsService } from '../../shared/notifications/notifications.service' ;
27- import { NotificationsServiceStub } from '../../shared/testing/notifications-service.stub' ;
28- import { APP_CONFIG } from '../../../config/app-config.interface' ;
291import {
302 ChangeDetectionStrategy ,
313 PLATFORM_ID ,
@@ -42,6 +14,7 @@ import {
4214import { TranslateModule } from '@ngx-translate/core' ;
4315import { of as observableOf } from 'rxjs' ;
4416
17+ import { APP_CONFIG } from '../../../config/app-config.interface' ;
4518import { getBitstreamDownloadRoute } from '../../app-routing-paths' ;
4619import {
4720 SortDirection ,
@@ -159,7 +132,7 @@ describe('LuckySearchComponent', () => {
159132 { provide : HardRedirectService , useValue : hardRedirectService } ,
160133 { provide : PLATFORM_ID , useValue : 'browser' } ,
161134 { provide : NotificationsService , useValue : new NotificationsServiceStub ( ) } ,
162- { provide : APP_CONFIG , useValue : { } } ,
135+ { provide : APP_CONFIG , useValue : { } } ,
163136 ] ,
164137 } ) . overrideComponent ( LuckySearchComponent , {
165138 remove : {
@@ -395,11 +368,11 @@ describe('LuckySearchComponent', () => {
395368 // @ts -ignore: Accessing private method for testing
396369 component . appConfig = {
397370 luckySearchRedirects : {
398- default : 301
399- }
371+ default : 301 ,
372+ } ,
400373 } as any ;
401374 // @ts -ignore: Accessing private method for testing
402- component . currentFilter = { identifier : 'unknown' } ;
375+ component . currentFilter = { identifier : 'unknown' } ;
403376
404377 // @ts -ignore: Accessing private method for testing
405378 const result = component . getRedirectCode ( ) ;
@@ -410,10 +383,10 @@ describe('LuckySearchComponent', () => {
410383 it ( 'should return 302 when default is not set and identifier is not found' , ( ) => {
411384 // @ts -ignore: Accessing private method for testing
412385 component . appConfig = {
413- luckySearchRedirects : { }
386+ luckySearchRedirects : { } ,
414387 } as any ;
415388 // @ts -ignore: Accessing private method for testing
416- component . currentFilter = { identifier : 'unknown' } ;
389+ component . currentFilter = { identifier : 'unknown' } ;
417390
418391 // @ts -ignore: Accessing private method for testing
419392 const result = component . getRedirectCode ( ) ;
@@ -425,11 +398,11 @@ describe('LuckySearchComponent', () => {
425398 component . appConfig = {
426399 luckySearchRedirects : {
427400 default : 302 ,
428- 'legacy-id' : 301
429- }
401+ 'legacy-id' : 301 ,
402+ } ,
430403 } ;
431404 // @ts -ignore: Accessing private method for testing
432- component . currentFilter = { identifier : 'legacy-id' } ;
405+ component . currentFilter = { identifier : 'legacy-id' } ;
433406
434407 // @ts -ignore: Accessing private method for testing
435408 const result = component . getRedirectCode ( ) ;
0 commit comments