@@ -12,7 +12,6 @@ import {
12
12
ConverterService ,
13
13
OccConfig ,
14
14
OccEndpointsService ,
15
- OccFieldsService ,
16
15
} from '@spartacus/core' ;
17
16
import {
18
17
CancellationRequestEntryInputList ,
@@ -49,7 +48,6 @@ describe('OccOrderHistoryAdapter', () => {
49
48
let httpMock : HttpTestingController ;
50
49
let converter : ConverterService ;
51
50
let occEnpointsService : OccEndpointsService ;
52
- let occFieldsService : OccFieldsService ;
53
51
54
52
beforeEach ( ( ) => {
55
53
TestBed . configureTestingModule ( {
@@ -69,7 +67,6 @@ describe('OccOrderHistoryAdapter', () => {
69
67
httpMock = TestBed . inject ( HttpTestingController ) ;
70
68
converter = TestBed . inject ( ConverterService ) ;
71
69
occEnpointsService = TestBed . inject ( OccEndpointsService ) ;
72
- occFieldsService = TestBed . inject ( OccFieldsService ) ;
73
70
spyOn ( converter , 'pipeable' ) . and . callThrough ( ) ;
74
71
spyOn ( converter , 'convert' ) . and . callThrough ( ) ;
75
72
spyOn ( occEnpointsService , 'buildUrl' ) . and . callThrough ( ) ;
@@ -125,42 +122,14 @@ describe('OccOrderHistoryAdapter', () => {
125
122
} ) ;
126
123
127
124
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
- } ) ) ;
147
125
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 ) ;
153
126
occOrderHistoryAdapter . load ( userId , orderData . code ) . subscribe ( ) ;
154
127
httpMock . expectOne ( ( req : HttpRequest < any > ) => {
155
128
return req . method === 'GET' ;
156
129
} , `GET a single order` ) ;
157
130
expect ( occEnpointsService . buildUrl ) . toHaveBeenCalledWith ( 'orderDetail' , {
158
131
urlParams : { userId, orderId : orderData . code } ,
159
132
} ) ;
160
- expect ( occEnpointsService . buildUrl ) . toHaveBeenCalledWith ( 'quoteCode' , {
161
- urlParams : { userId, orderId : orderData . code } ,
162
- } ) ;
163
- expect ( occFieldsService . getOptimalUrlGroups ) . toHaveBeenCalled ( ) ;
164
133
} ) ) ;
165
134
166
135
it ( 'should use converter' , ( ) => {
0 commit comments