Skip to content

Commit c160e50

Browse files
committed
fix failing test in build
1 parent 53a0d56 commit c160e50

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/services/sync.service.spec.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ import { SingleRequestBuilder } from "./single-request-builder";
2222
import { StateService } from "./state.service";
2323
import { SyncService } from "./sync.service";
2424

25+
class MockApiService {
26+
postPublicImportDirectory() {}
27+
}
28+
2529
describe("SyncService", () => {
2630
let logService: MockProxy<LogService>;
2731
let cryptoFunctionService: MockProxy<CryptoFunctionService>;
28-
let apiService: MockProxy<ApiService>;
32+
let apiService: MockApiService;
2933
let messagingService: MockProxy<MessagingService>;
3034
let i18nService: MockProxy<I18nService>;
3135
let environmentService: MockProxy<EnvironmentService>;
@@ -57,7 +61,7 @@ describe("SyncService", () => {
5761
syncService = mock(
5862
new SyncService(
5963
cryptoFunctionService,
60-
apiService,
64+
apiService as ApiService,
6165
messagingService,
6266
i18nService,
6367
environmentService,
@@ -117,12 +121,12 @@ describe("SyncService", () => {
117121
await syncService.sync(true, false);
118122

119123
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]);
126130
});
127131

128132
it("does not post for the same hash", async () => {

0 commit comments

Comments
 (0)