@@ -11,6 +11,8 @@ import { createSuccessfulRemoteDataObject } from '../../shared/remote-data.utils
1111import { Item } from '../shared/item.model' ;
1212import { EMBED_SEPARATOR } from './base/base-data.service' ;
1313import { HardRedirectService } from '../services/hard-redirect.service' ;
14+ import { environment } from '../../../environments/environment.test' ;
15+ import { AppConfig } from '../../../config/app-config.interface' ;
1416
1517describe ( 'DsoRedirectService' , ( ) => {
1618 let scheduler : TestScheduler ;
@@ -56,6 +58,7 @@ describe('DsoRedirectService', () => {
5658 } ) ;
5759
5860 service = new DsoRedirectService (
61+ environment as AppConfig ,
5962 requestService ,
6063 rdbService ,
6164 objectCache ,
@@ -107,7 +110,7 @@ describe('DsoRedirectService', () => {
107110 redir . subscribe ( ) ;
108111 scheduler . schedule ( ( ) => redir ) ;
109112 scheduler . flush ( ) ;
110- expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ' /items/' + remoteData . payload . uuid , 301 ) ;
113+ expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ` ${ environment . ui . nameSpace } /items/${ remoteData . payload . uuid } ` , 301 ) ;
111114 } ) ;
112115 it ( 'should navigate to entities route with the corresponding entity type' , ( ) => {
113116 remoteData . payload . type = 'item' ;
@@ -124,7 +127,7 @@ describe('DsoRedirectService', () => {
124127 redir . subscribe ( ) ;
125128 scheduler . schedule ( ( ) => redir ) ;
126129 scheduler . flush ( ) ;
127- expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ' /entities/publication/' + remoteData . payload . uuid , 301 ) ;
130+ expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ` ${ environment . ui . nameSpace } /entities/publication/${ remoteData . payload . uuid } ` , 301 ) ;
128131 } ) ;
129132
130133 it ( 'should navigate to collections route' , ( ) => {
@@ -133,7 +136,7 @@ describe('DsoRedirectService', () => {
133136 redir . subscribe ( ) ;
134137 scheduler . schedule ( ( ) => redir ) ;
135138 scheduler . flush ( ) ;
136- expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ' /collections/' + remoteData . payload . uuid , 301 ) ;
139+ expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ` ${ environment . ui . nameSpace } /collections/${ remoteData . payload . uuid } ` , 301 ) ;
137140 } ) ;
138141
139142 it ( 'should navigate to communities route' , ( ) => {
@@ -142,7 +145,7 @@ describe('DsoRedirectService', () => {
142145 redir . subscribe ( ) ;
143146 scheduler . schedule ( ( ) => redir ) ;
144147 scheduler . flush ( ) ;
145- expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ' /communities/' + remoteData . payload . uuid , 301 ) ;
148+ expect ( redirectService . redirect ) . toHaveBeenCalledWith ( ` ${ environment . ui . nameSpace } /communities/${ remoteData . payload . uuid } ` , 301 ) ;
146149 } ) ;
147150 } ) ;
148151
0 commit comments