feat(downloads): add option to limit amount of items (#3205)
This commit is contained in:
@@ -46,7 +46,7 @@ describe("Aria2 integration", () => {
|
||||
|
||||
// Acts
|
||||
const actAsync = async () => await aria2Integration.pauseQueueAsync();
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync();
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync({ limit: 99 });
|
||||
|
||||
// Assert
|
||||
await expect(actAsync()).resolves.not.toThrow();
|
||||
@@ -62,7 +62,7 @@ describe("Aria2 integration", () => {
|
||||
const aria2Integration = createAria2Intergration(startedContainer, API_KEY);
|
||||
|
||||
// Act
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync();
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync({ limit: 99 });
|
||||
|
||||
// Assert
|
||||
await expect(getAsync()).resolves.not.toThrow();
|
||||
@@ -81,7 +81,7 @@ describe("Aria2 integration", () => {
|
||||
await aria2AddItemAsync(startedContainer, API_KEY, aria2Integration);
|
||||
|
||||
// Act
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync();
|
||||
const getAsync = async () => await aria2Integration.getClientJobsAndStatusAsync({ limit: 99 });
|
||||
|
||||
// Assert
|
||||
await expect(getAsync()).resolves.not.toThrow();
|
||||
@@ -104,7 +104,7 @@ describe("Aria2 integration", () => {
|
||||
await expect(actAsync()).resolves.not.toThrow();
|
||||
// NzbGet is slow and we wait for a second before querying the items. Test was flaky without this.
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
const result = await aria2Integration.getClientJobsAndStatusAsync();
|
||||
const result = await aria2Integration.getClientJobsAndStatusAsync({ limit: 99 });
|
||||
expect(result.items).toHaveLength(0);
|
||||
|
||||
// Cleanup
|
||||
@@ -153,7 +153,7 @@ const aria2AddItemAsync = async (container: StartedTestContainer, apiKey: string
|
||||
|
||||
const {
|
||||
items: [item],
|
||||
} = await integration.getClientJobsAndStatusAsync();
|
||||
} = await integration.getClientJobsAndStatusAsync({ limit: 99 });
|
||||
|
||||
if (!item) {
|
||||
throw new Error("No item found");
|
||||
|
||||
Reference in New Issue
Block a user