mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 22:25:24 +00:00
feat: Allow to disable showing paths to folders (#1274)
https://github.com/Termix-SSH/Support/issues/1274
This commit is contained in:
1 parent
6ce5e78165
commit
d0c25cf183
7 files changed
+46
-1
No files matched your search
@@ -26,6 +26,7 @@ describe("defaultHostSidebarPreferences", () => {
|
||||
trayTrigger: "always",
|
||||
statusColorScheme: "accent",
|
||||
openOnDoubleClick: false,
|
||||
showFolderPaths: true,
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -63,6 +64,7 @@ describe("sanitizeHostSidebarPreferences", () => {
|
||||
trayTrigger: "click",
|
||||
statusColorScheme: "status",
|
||||
openOnDoubleClick: true,
|
||||
showFolderPaths: false,
|
||||
},
|
||||
};
|
||||
expect(sanitizeHostSidebarPreferences(valid)).toEqual(valid);
|
||||
@@ -78,6 +80,16 @@ describe("sanitizeHostSidebarPreferences", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("defaults showFolderPaths to true when missing or not a boolean", () => {
|
||||
expect(
|
||||
sanitizeHostSidebarPreferences({ display: {} }).display.showFolderPaths,
|
||||
).toBe(true);
|
||||
expect(
|
||||
sanitizeHostSidebarPreferences({ display: { showFolderPaths: "no" } })
|
||||
.display.showFolderPaths,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("falls back to defaults for invalid enum values", () => {
|
||||
const result = sanitizeHostSidebarPreferences({
|
||||
sort: { key: "not-a-real-key", pinnedFirst: "yes" },
|
||||
|
||||
Reference in new issue
Block a user