Add encrypted Deepbrid API accounts with account validation, provider routing, fallback, usage tracking, safe error handling, and verified 1Fichier downloads. Restore persistent recurring daily starts with local-calendar deduplication and legacy schedule compatibility. Add durable Discord package, run, remaining-volume, stall, and recovery notifications with privacy-safe telemetry and disk-failure recovery.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { readFile } from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { ACCOUNT_SERVICE_ICONS } from "../src/renderer/account-service-icons";
|
|
|
|
const services = [
|
|
"realdebrid",
|
|
"megadebrid-api",
|
|
"megadebrid-web",
|
|
"bestdebrid",
|
|
"alldebrid",
|
|
"deepbrid",
|
|
"ddownload",
|
|
"onefichier",
|
|
"debridlink",
|
|
"linksnappy"
|
|
] as const;
|
|
|
|
describe("account service icons", () => {
|
|
it("bundles a valid local PNG or ICO for every account service", async () => {
|
|
expect(Object.keys(ACCOUNT_SERVICE_ICONS).sort()).toEqual([...services].sort());
|
|
for (const service of services) {
|
|
const relativePath = ACCOUNT_SERVICE_ICONS[service];
|
|
expect(relativePath.startsWith("./provider-icons/")).toBe(true);
|
|
const bytes = await readFile(path.resolve("assets", relativePath.slice(2)));
|
|
const png = bytes.subarray(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]));
|
|
const ico = bytes.subarray(0, 4).equals(Buffer.from([0x00, 0x00, 0x01, 0x00]));
|
|
expect(png || ico).toBe(true);
|
|
}
|
|
});
|
|
|
|
it("uses the same Mega-Debrid icon for API and Web accounts", () => {
|
|
expect(ACCOUNT_SERVICE_ICONS["megadebrid-api"]).toBe(ACCOUNT_SERVICE_ICONS["megadebrid-web"]);
|
|
});
|
|
|
|
it("uses the bundled Deepbrid provider icon", () => {
|
|
expect(ACCOUNT_SERVICE_ICONS.deepbrid).toBe("./provider-icons/deepbrid.png");
|
|
});
|
|
});
|