feat(settings): expose Real-Debrid multi-account controls
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildAccountCreateCommand, createAccountDialogState } from "../src/renderer/App";
|
||||
import { buildAccountCreateCommand, buildRealDebridWebCreateLoginRequest, createAccountDialogState } from "../src/renderer/App";
|
||||
import { createRendererSettings } from "../src/main/renderer-state";
|
||||
import { defaultSettings } from "../src/main/constants";
|
||||
|
||||
@@ -27,4 +27,18 @@ describe("account creation dialog", () => {
|
||||
expect(dialog.password).toBe("");
|
||||
expect(dialog.megaAccounts).toEqual([]);
|
||||
});
|
||||
|
||||
it("forwards the selected daily limit with a newly reserved Real-Debrid Web account", () => {
|
||||
const settings = createRendererSettings(defaultSettings());
|
||||
const dialog = {
|
||||
...createAccountDialogState("create", "realdebrid-web", settings),
|
||||
dailyLimitGb: "2,5"
|
||||
};
|
||||
|
||||
expect(buildRealDebridWebCreateLoginRequest(dialog, "rdw_reservedopaqueid")).toEqual({
|
||||
accountId: "rdw_reservedopaqueid",
|
||||
create: true,
|
||||
dailyLimitBytes: Math.floor(2.5 * 1024 * 1024 * 1024)
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user