@@ -22,10 +22,14 @@ import { SingleRequestBuilder } from "./single-request-builder";
22
22
import { StateService } from "./state.service" ;
23
23
import { SyncService } from "./sync.service" ;
24
24
25
+ class MockApiService {
26
+ postPublicImportDirectory ( ) { }
27
+ }
28
+
25
29
describe ( "SyncService" , ( ) => {
26
30
let logService : MockProxy < LogService > ;
27
31
let cryptoFunctionService : MockProxy < CryptoFunctionService > ;
28
- let apiService : MockProxy < ApiService > ;
32
+ let apiService : MockApiService ;
29
33
let messagingService : MockProxy < MessagingService > ;
30
34
let i18nService : MockProxy < I18nService > ;
31
35
let environmentService : MockProxy < EnvironmentService > ;
@@ -57,7 +61,7 @@ describe("SyncService", () => {
57
61
syncService = mock (
58
62
new SyncService (
59
63
cryptoFunctionService ,
60
- apiService ,
64
+ apiService as ApiService ,
61
65
messagingService ,
62
66
i18nService ,
63
67
environmentService ,
@@ -117,12 +121,12 @@ describe("SyncService", () => {
117
121
await syncService . sync ( true , false ) ;
118
122
119
123
expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledTimes ( 6 ) ;
120
- expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( {
121
- members : [ ] ,
122
- groups : [ ] ,
123
- overwriteExisting : true ,
124
- largeImport : true ,
125
- } ) ;
124
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 0 ] ) ;
125
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 1 ] ) ;
126
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 2 ] ) ;
127
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 3 ] ) ;
128
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 4 ] ) ;
129
+ expect ( apiService . postPublicImportDirectory ) . toHaveBeenCalledWith ( mockRequests [ 5 ] ) ;
126
130
} ) ;
127
131
128
132
it ( "does not post for the same hash" , async ( ) => {
0 commit comments