Skip to content

Commit e10ab44

Browse files
committed
Update tests
1 parent 3090768 commit e10ab44

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/batch.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ describe.each([
2020
await client.waitForTask(taskUid);
2121
});
2222

23+
test(`${permission} key: Get all batches`, async () => {
24+
const client = await getClient(permission);
25+
const batches = await client.getBatches();
26+
expect(batches.results.length).toBeGreaterThan(0);
27+
});
28+
2329
test(`${permission} key: Get one batch`, async () => {
2430
const client = await getClient(permission);
25-
const batch = await client.getBatch(1);
26-
expect(batch.uid).toEqual(1);
27-
expect(batch.details).toHaveProperty("receivedDocuments");
28-
expect(batch.details).toHaveProperty("indexedDocuments");
31+
32+
const batches = await client.getBatches();
33+
const batch = await client.getBatch(batches.results[0].uid);
34+
expect(batch.uid).toEqual(batches.results[0].uid);
35+
expect(batch.details).toBeDefined();
2936
expect(batch.stats).toHaveProperty("totalNbTasks");
3037
expect(batch.stats).toHaveProperty("status");
3138
expect(batch.stats).toHaveProperty("types");

0 commit comments

Comments
 (0)