fix(media widget): text size fix and added season + Episode info (#6605)
Co-authored-by: Thomas <thomas@ajnart.fr>
This commit is contained in:
1 parent
e842177d9b
commit
ebdfeb724b
61 files changed
+254
-182
No files matched your search
@@ -9,7 +9,7 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
|
||||
import type { StreamSession } from "@homarr/integrations";
|
||||
|
||||
import { getMediaServerColumnVisibility, SessionDetailsPopover } from "./component";
|
||||
import { getMediaServerColumnVisibility, getSeasonEpisodeParams, SessionDetailsPopover } from "./component";
|
||||
|
||||
vi.mock("@homarr/translation/client", () => ({
|
||||
useScopedI18n: () => (key: string) => key,
|
||||
@@ -108,3 +108,19 @@ describe("getMediaServerColumnVisibility", () => {
|
||||
expect(getMediaServerColumnVisibility(0, true)).toEqual({ user: true, status: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe("getSeasonEpisodeParams", () => {
|
||||
test("zero-pads season and episode numbers", () => {
|
||||
expect(getSeasonEpisodeParams(4, 12)).toEqual({ season: "04", episode: "12" });
|
||||
});
|
||||
|
||||
test("does not pad numbers already two digits or longer", () => {
|
||||
expect(getSeasonEpisodeParams(12, 104)).toEqual({ season: "12", episode: "104" });
|
||||
});
|
||||
|
||||
test("returns null when either number is missing", () => {
|
||||
expect(getSeasonEpisodeParams(undefined, 12)).toBeNull();
|
||||
expect(getSeasonEpisodeParams(4, null)).toBeNull();
|
||||
expect(getSeasonEpisodeParams(null, undefined)).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user