fix: isolate downloads stats state
This commit is contained in:
4 files changed
+42
-10
No files matched your search
@@ -5,6 +5,7 @@ import {
|
||||
filterDownloadItemsByStatus,
|
||||
getAvailableDownloadStates,
|
||||
getDownloadColumnAccessors,
|
||||
getDownloadsStatsDisplay,
|
||||
} from "./helpers";
|
||||
|
||||
describe("downloads filters", () => {
|
||||
@@ -29,3 +30,22 @@ describe("downloads advanced columns", () => {
|
||||
expect(getDownloadColumnAccessors(["name"], false)).toEqual(["name"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("downloads stats display", () => {
|
||||
test("keeps advanced stats independent from the compact toggle", () => {
|
||||
const compactStatsVisible = false;
|
||||
|
||||
expect(
|
||||
[true, false, true, false].map((isAdvanced) => getDownloadsStatsDisplay(compactStatsVisible, isAdvanced)),
|
||||
).toEqual([
|
||||
{ visible: true, canToggle: false },
|
||||
{ visible: false, canToggle: true },
|
||||
{ visible: true, canToggle: false },
|
||||
{ visible: false, canToggle: true },
|
||||
]);
|
||||
});
|
||||
|
||||
test("preserves an explicitly enabled compact stats bar", () => {
|
||||
expect(getDownloadsStatsDisplay(true, false)).toEqual({ visible: true, canToggle: true });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user