feat: rebuild onboarding experience
This commit is contained in:
1 parent
d091362db2
commit
e41605640b
249 files changed
+8216
-14060
No files matched your search
@@ -1,8 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getIntegrationApiKeyUrl } from "../integration";
|
||||
import { getIntegrationApiKeyUrl, integrationDefs } from "../integration";
|
||||
|
||||
describe("getIntegrationApiKeyUrl", () => {
|
||||
it("links every user-facing integration to its Homarr setup guide", () => {
|
||||
expect(
|
||||
Object.entries(integrationDefs)
|
||||
.filter(([kind, definition]) => kind !== "mock" && !definition.documentationUrl)
|
||||
.map(([kind]) => kind),
|
||||
).toEqual([]);
|
||||
});
|
||||
|
||||
it("builds URL for sonarr", () => {
|
||||
expect(getIntegrationApiKeyUrl("http://192.168.1.10:8989", "sonarr")).toBe(
|
||||
"http://192.168.1.10:8989/settings/general",
|
||||
@@ -21,10 +29,28 @@ describe("getIntegrationApiKeyUrl", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("returns null for integrations without apiKeySettingsPath", () => {
|
||||
expect(getIntegrationApiKeyUrl("http://localhost", "plex")).toBeNull();
|
||||
it.each([
|
||||
["homeAssistant", "http://homeassistant.local:8123", "http://homeassistant.local:8123/profile/security"],
|
||||
["opnsense", "https://firewall.local", "https://firewall.local/system_usermanager.php"],
|
||||
["ntfy", "https://ntfy.local", "https://ntfy.local/account"],
|
||||
["anchor", "http://anchor.local:8080", "http://anchor.local:8080/settings"],
|
||||
["unraid", "http://tower.local", "http://tower.local/Settings/ManagementAccess"],
|
||||
["coolify", "https://coolify.local", "https://coolify.local/security/api-tokens"],
|
||||
["immich", "http://immich.local:2283", "http://immich.local:2283/user-settings"],
|
||||
["tracearr", "http://tracearr.local:7040", "http://tracearr.local:7040/settings"],
|
||||
["speedtestTracker", "http://speedtest.local", "http://speedtest.local/admin/api-tokens"],
|
||||
["uptimeKuma", "http://uptime.local:3001", "http://uptime.local:3001/settings/api-keys"],
|
||||
] as const)("builds a verified credential URL for %s", (kind, baseUrl, expected) => {
|
||||
expect(getIntegrationApiKeyUrl(baseUrl, kind)).toBe(expected);
|
||||
});
|
||||
|
||||
it.each(["plex", "piHole", "truenas"] as const)(
|
||||
"returns null when %s has no version-safe credential path",
|
||||
(kind) => {
|
||||
expect(getIntegrationApiKeyUrl("http://localhost", kind)).toBeNull();
|
||||
},
|
||||
);
|
||||
|
||||
it("returns null for empty URL", () => {
|
||||
expect(getIntegrationApiKeyUrl("", "sonarr")).toBeNull();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user