feat(playlists): act on the selected rows from the toolbar, and undo either
While rows are selected the toolbar's second row is the band: the count, the last target as one click, Move to, Remove, Clear selection. Both write in one request and undo back to the places; a video the target held before stays there. Delete takes the selection when there is one. A failure puts the rows back ticked. A row's own move goes through the same write, so it undoes too, and the single-row move route and service function are gone. A playlist row drops its grip below a 24rem table: the row menu keeps the moves.
This commit is contained in:
@@ -129,6 +129,22 @@ describe("useRowSelection", () => {
|
||||
expect(result.current.shownSelected).toEqual(["c"]);
|
||||
});
|
||||
|
||||
it("counts the selected rows a filter hides", () => {
|
||||
const { result, rerender } = setup();
|
||||
act(() => result.current.toggle("a"));
|
||||
act(() => result.current.toggle("c"));
|
||||
expect(result.current.hiddenCount).toBe(0);
|
||||
rerender({ all: ABCDE, shown: ["c", "d"], scope: 1 });
|
||||
expect(result.current.hiddenCount).toBe(1);
|
||||
});
|
||||
|
||||
it("ticks rows again on top of what is selected by then", () => {
|
||||
const { result } = setup();
|
||||
act(() => result.current.toggle("e"));
|
||||
act(() => result.current.select(["a", "b"]));
|
||||
expect(result.current.shownSelected).toEqual(["a", "b", "e"]);
|
||||
});
|
||||
|
||||
it("says whether clearing did anything", () => {
|
||||
const { result } = setup();
|
||||
let cleared = true;
|
||||
|
||||
Reference in New Issue
Block a user