fix(notifications): "Find in feed" drops every narrowing that could hide the video
locate() spread the reader's filters and cleared only the tag, search and age cap, so a year, a custom range, a length, a content type (a hidden Short under "no Shorts") or the scope could still leave the video out. It builds the filters from nothing now, keeping only the sort and tag modes. (Also types the C1 test's pending plan.)
This commit is contained in:
@@ -46,7 +46,28 @@ vi.mock("../lib/notifications", async (importOriginal) => ({
|
||||
vi.mock("./navigationContext", () => ({ useNavigationActions: () => ({ setPage: h.setPage }) }));
|
||||
vi.mock("./channelsContext", () => ({ useChannelsActions: () => ({ focusChannel: vi.fn() }) }));
|
||||
vi.mock("./feedFiltersContext", () => ({
|
||||
useFeedFilters: () => ({ tags: [54], untagged: true, q: "rust", maxAgeDays: 30, sort: "newest" }),
|
||||
// Every narrowing a feed can carry (E28 review C2: the year, the custom range, the length, the
|
||||
// content types and the scope survived "Find in feed" and could still hide the video).
|
||||
useFeedFilters: () => ({
|
||||
tags: [54],
|
||||
tagModes: { language: "and", topic: "or", other: "or" },
|
||||
untagged: true,
|
||||
q: "rust",
|
||||
maxAgeDays: 30,
|
||||
dateFrom: "2024-01-01",
|
||||
dateTo: "2024-02-01",
|
||||
year: 2024,
|
||||
minDuration: 60,
|
||||
maxDuration: 600,
|
||||
includeNormal: true,
|
||||
includeShorts: false,
|
||||
includeLive: false,
|
||||
scope: "my",
|
||||
librarySource: "organic",
|
||||
sort: "oldest",
|
||||
show: "unwatched",
|
||||
channelIds: ["x"],
|
||||
}),
|
||||
useFeedFiltersActions: () => ({ setFilters: h.setFilters }),
|
||||
}));
|
||||
vi.mock("./ui/PageShell", async (importOriginal) => ({
|
||||
@@ -223,12 +244,18 @@ describe("NotificationsPanel · an activity row", () => {
|
||||
await openMenu(() => fireEvent.contextMenu(rowOf("Activity 9")));
|
||||
choose("notifications.findInFeed");
|
||||
await waitFor(() => expect(h.setFilters).toHaveBeenCalled());
|
||||
// Nothing but the state and the channel narrows; the reader's sort and tag modes stay theirs.
|
||||
expect(h.setFilters).toHaveBeenCalledWith({
|
||||
tags: [],
|
||||
tagModes: { language: "and", topic: "or", other: "or" },
|
||||
untagged: false,
|
||||
q: "",
|
||||
maxAgeDays: undefined,
|
||||
sort: "newest",
|
||||
includeNormal: true,
|
||||
includeShorts: true,
|
||||
includeLive: true,
|
||||
scope: "all",
|
||||
librarySource: "all",
|
||||
sort: "oldest",
|
||||
show: "watched",
|
||||
channelIds: ["c"],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user