fix(plex): a card offers Restart by the menu's own "started" rule
The picture read "started" off the rounded progress %, so a resume point under 1 % showed Play while the card's menu offered "from the start". Both use `plexStarted` now.
This commit is contained in:
@@ -208,6 +208,19 @@ describe("a started Plex card", () => {
|
||||
expect(container.querySelector(".flex-col.reveal-hover")).toBeNull();
|
||||
});
|
||||
|
||||
// E28 review D4: the card read "started" off the rounded progress %, the menu off the position —
|
||||
// 20 s into a 3 h film is 0 % here and started there, so the card offered no Restart the menu had.
|
||||
it("a resume point under 1 % still offers the Restart, as the card's menu does", () => {
|
||||
render(
|
||||
<PlexPosterCard
|
||||
card={{ ...movie("in_progress"), position_seconds: 20, duration_seconds: 10800 }}
|
||||
onOpen={vi.fn()}
|
||||
onRestart={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
expect(screen.getByRole("button", { name: "card.restart" })).toBeTruthy();
|
||||
});
|
||||
|
||||
it("a not-started or watched card keeps the one Play", () => {
|
||||
render(<PlexPosterCard card={movie("watched")} onOpen={vi.fn()} onRestart={vi.fn()} />);
|
||||
expect(screen.queryByRole("button", { name: "card.restart" })).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user