The OS media title printed the missing number as "Enull", the player and info headers as a bare "E". One helper for the three lines.
21 lines
654 B
TypeScript
21 lines
654 B
TypeScript
// @vitest-environment jsdom
|
|
import { describe, expect, it } from "vitest";
|
|
import { episodeLine } from "./plexDetail";
|
|
|
|
describe("episodeLine", () => {
|
|
it("names the episode by its season and number", () => {
|
|
expect(episodeLine({ season_number: 2, episode_number: 7, title: "Pilot" })).toBe(
|
|
"S2·E7 — Pilot",
|
|
);
|
|
});
|
|
|
|
it("is the title alone for an episode Plex has no number for", () => {
|
|
expect(episodeLine({ season_number: 1, episode_number: null, title: "Special" })).toBe(
|
|
"Special",
|
|
);
|
|
expect(episodeLine({ season_number: null, episode_number: 3, title: "Special" })).toBe(
|
|
"Special",
|
|
);
|
|
});
|
|
});
|