Files
silo-server/web/src/lib/jellyfinCompat.test.ts
5afe56cfc0 feat(jellycompat): add runtime-managed Jellyfin Web compatibility (#77)
* feat(jellycompat): install web assets at runtime

* fix(jellycompat): recover stale web operation locks

* fix(jellycompat): harden web component management

* feat(admin): refine compat settings and restart status

* chore(dev): add hot-reload docker compose stack

* fix(dev): include npm in hot-reload backend

* feat(admin): refine Jellyfin compatibility settings

* feat(settings): improve jellyfin proxy summary

* feat(settings): improve jellyfin web controls

* fix(settings): update jellyfin web removal status

* fix(settings): enable jellyfin web after install

* feat(jellycompat): auto-select web ui version

* test(api): update rate limit handler setup

* feat(jellycompat): refine web ui install onboarding

* fix(jellycompat): address web ui install review issues

* fix(onboarding): mirror jellyfin api runtime status

* fix(admin): remove global restart banner

* fix(settings): gate restart required tracking

* fix(jellyfin): ignore live settings for restart status

* fix(jellyfin): avoid restart for live compat settings

* fix(subtitles): normalize AI language codes

* fix(catalog): support partial title search tokens

* feat(branding): add white-label customization

* Add push relay engineering plan

- Document relay API contracts, APNs/FCM behavior, auth, storage, and ops
- Capture implementation plan, provider references, decisions, and README

---------

Co-authored-by: Quick <31828688+Quick104@users.noreply.github.com>
2026-06-15 09:34:08 -04:00

32 lines
1.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { hasPinnedJellyfinWebInstalled, normalizeJellyfinCompatVersion } from "./jellyfinCompat";
type JellyfinWebInstallStatus = Parameters<typeof hasPinnedJellyfinWebInstalled>[0];
function status(overrides: Partial<NonNullable<JellyfinWebInstallStatus>> = {}) {
return {
pinned_version: "10.11.6",
installed_version: "10.11.6",
...overrides,
} satisfies NonNullable<JellyfinWebInstallStatus>;
}
describe("jellyfinCompat helpers", () => {
it("normalizes leading v prefixes", () => {
expect(normalizeJellyfinCompatVersion(" v10.11.6 ")).toBe("10.11.6");
expect(normalizeJellyfinCompatVersion("V10.11.6")).toBe("10.11.6");
});
it("detects when the installed Web UI matches the pinned version", () => {
expect(hasPinnedJellyfinWebInstalled(status())).toBe(true);
expect(hasPinnedJellyfinWebInstalled(status({ installed_version: "v10.11.6" }))).toBe(true);
});
it("does not treat missing or outdated installs as the pinned version", () => {
expect(hasPinnedJellyfinWebInstalled(status({ installed_version: "" }))).toBe(false);
expect(hasPinnedJellyfinWebInstalled(status({ installed_version: "10.11.5" }))).toBe(false);
expect(hasPinnedJellyfinWebInstalled(null)).toBe(false);
});
});