@@ -12,7 +12,6 @@ import {
1212 ConverterService ,
1313 OccConfig ,
1414 OccEndpointsService ,
15- OccFieldsService ,
1615} from '@spartacus/core' ;
1716import {
1817 CancellationRequestEntryInputList ,
@@ -49,7 +48,6 @@ describe('OccOrderHistoryAdapter', () => {
4948 let httpMock : HttpTestingController ;
5049 let converter : ConverterService ;
5150 let occEnpointsService : OccEndpointsService ;
52- let occFieldsService : OccFieldsService ;
5351
5452 beforeEach ( ( ) => {
5553 TestBed . configureTestingModule ( {
@@ -69,7 +67,6 @@ describe('OccOrderHistoryAdapter', () => {
6967 httpMock = TestBed . inject ( HttpTestingController ) ;
7068 converter = TestBed . inject ( ConverterService ) ;
7169 occEnpointsService = TestBed . inject ( OccEndpointsService ) ;
72- occFieldsService = TestBed . inject ( OccFieldsService ) ;
7370 spyOn ( converter , 'pipeable' ) . and . callThrough ( ) ;
7471 spyOn ( converter , 'convert' ) . and . callThrough ( ) ;
7572 spyOn ( occEnpointsService , 'buildUrl' ) . and . callThrough ( ) ;
@@ -125,42 +122,14 @@ describe('OccOrderHistoryAdapter', () => {
125122 } ) ;
126123
127124 describe ( 'getOrder' , ( ) => {
128- it ( 'should fetch a single order without quote code' , waitForAsync ( ( ) => {
129- spyOn (
130- ( occOrderHistoryAdapter as any ) . featureConfigService ,
131- 'isEnabled'
132- ) . and . returnValue ( false ) ;
133- occOrderHistoryAdapter . load ( userId , orderData . code ) . subscribe ( ) ;
134- httpMock . expectOne ( ( req : HttpRequest < any > ) => {
135- return req . method === 'GET' ;
136- } , `GET a single order` ) ;
137- expect ( occEnpointsService . buildUrl ) . toHaveBeenCalledWith ( 'orderDetail' , {
138- urlParams : { userId, orderId : orderData . code } ,
139- } ) ;
140- expect ( occEnpointsService . buildUrl ) . not . toHaveBeenCalledWith (
141- 'quoteCode' ,
142- {
143- urlParams : { userId, orderId : orderData . code } ,
144- }
145- ) ;
146- } ) ) ;
147125 it ( 'should fetch a single order' , waitForAsync ( ( ) => {
148- spyOn ( occFieldsService , 'getOptimalUrlGroups' ) . and . callThrough ( ) ;
149- spyOn (
150- ( occOrderHistoryAdapter as any ) . featureConfigService ,
151- 'isEnabled'
152- ) . and . returnValue ( true ) ;
153126 occOrderHistoryAdapter . load ( userId , orderData . code ) . subscribe ( ) ;
154127 httpMock . expectOne ( ( req : HttpRequest < any > ) => {
155128 return req . method === 'GET' ;
156129 } , `GET a single order` ) ;
157130 expect ( occEnpointsService . buildUrl ) . toHaveBeenCalledWith ( 'orderDetail' , {
158131 urlParams : { userId, orderId : orderData . code } ,
159132 } ) ;
160- expect ( occEnpointsService . buildUrl ) . toHaveBeenCalledWith ( 'quoteCode' , {
161- urlParams : { userId, orderId : orderData . code } ,
162- } ) ;
163- expect ( occFieldsService . getOptimalUrlGroups ) . toHaveBeenCalled ( ) ;
164133 } ) ) ;
165134
166135 it ( 'should use converter' , ( ) => {
0 commit comments