// @vitest-environment jsdom // // The Plex player draws its subtitles itself. With the browser drawing them, the control bar covered // the text on an iPad whenever it was up: a native cue is placed by `line`, which nothing animates. import { afterEach, beforeAll, describe, expect, it, vi } from "vitest"; import { act, cleanup, render, screen } from "@testing-library/react"; import { createRef } from "react"; import PlexSubtitles from "./PlexSubtitles"; beforeAll(() => { class Stub { observe() {} unobserve() {} disconnect() {} } globalThis.ResizeObserver ??= Stub as unknown as typeof ResizeObserver; }); afterEach(() => { cleanup(); vi.restoreAllMocks(); }); type FakeTrack = EventTarget & { kind: string; mode: TextTrackMode; activeCues: unknown[] }; /** A