fix(settings): point debug-logging search hit at the About tab
This commit is contained in:
3 files changed
+62
-1
No files matched your search
@@ -132,6 +132,31 @@ describe("settings search", () => {
|
||||
expect(webEntries.map((entry) => entry.id)).toEqual(expect.arrayContaining(["sql-file-editor-max-mb", "sql-file-web-upload-max-mb"]));
|
||||
});
|
||||
|
||||
it("points the debug logging result at the About tab that renders the switch", () => {
|
||||
// The 启用调试日志 switch (id="debug-logging-enabled") is rendered inside the
|
||||
// About section, next to the debug log copy/download/clear actions. The
|
||||
// search entry used to claim "appearance", so picking the result switched
|
||||
// to 外观 and never revealed the control (regression from #10308).
|
||||
expect(SETTINGS_SEARCH_DEFINITIONS).toContainEqual({
|
||||
id: "about-debug-logs",
|
||||
category: "about",
|
||||
titleKey: "settings.debugLoggingEnabled",
|
||||
descriptionKey: "settings.debugLoggingEnabledDescription",
|
||||
targetId: "about",
|
||||
visible: expect.any(Function),
|
||||
});
|
||||
expect(SETTINGS_SEARCH_DEFINITIONS.map((definition) => definition.id)).not.toContain("appearance-debug-logs");
|
||||
|
||||
const desktopEntries = resolveSettingsSearchEntries(SETTINGS_SEARCH_DEFINITIONS, { isWeb: false, visibleCategories: new Set<SettingsCategory>(["appearance", "about"]) }, translate, categoryLabels);
|
||||
const entry = desktopEntries.find((item) => item.id === "about-debug-logs");
|
||||
expect(entry?.category).toBe("about");
|
||||
expect(entry?.categoryLabel).toBe("About");
|
||||
expect(entry?.targetId).toBe("about");
|
||||
|
||||
const webEntries = resolveSettingsSearchEntries(SETTINGS_SEARCH_DEFINITIONS, { isWeb: true, visibleCategories: new Set<SettingsCategory>(["appearance", "about"]) }, translate, categoryLabels);
|
||||
expect(webEntries.map((item) => item.id)).not.toContain("about-debug-logs");
|
||||
});
|
||||
|
||||
it("maps legacy SQL file settings navigation to the editor", () => {
|
||||
expect(resolveSettingsCategory("sqlFile")).toBe("editor");
|
||||
expect(resolveSettingsCategory()).toBe("appearance");
|
||||
|
||||
@@ -189,7 +189,7 @@ export const SETTINGS_SEARCH_DEFINITIONS: readonly SettingsSearchDefinition[] =
|
||||
{ id: "appearance-icons", category: "appearance", titleKey: "settings.iconTheme", targetId: "appearance", visible: desktopOnly },
|
||||
{ id: "appearance-tray", category: "appearance", titleKey: "settings.showTrayIcon", descriptionKey: "settings.showTrayIconDescription", targetId: "appearance", visible: desktopOnly },
|
||||
{ id: "appearance-quit", category: "appearance", titleKey: "settings.quitOnClose", descriptionKey: "settings.quitOnCloseDescription", targetId: "appearance", visible: desktopOnly },
|
||||
{ id: "appearance-debug-logs", category: "appearance", titleKey: "settings.debugLoggingEnabled", descriptionKey: "settings.debugLoggingEnabledDescription", targetId: "appearance", visible: desktopOnly },
|
||||
{ id: "about-debug-logs", category: "about", titleKey: "settings.debugLoggingEnabled", descriptionKey: "settings.debugLoggingEnabledDescription", targetId: "about", visible: desktopOnly },
|
||||
{ id: "navigation", category: "navigation", titleKey: "settings.navigationTab", targetId: "navigation" },
|
||||
{ id: "navigation-sidebar", category: "navigation", titleKey: "settings.sidebarActivation", targetId: "navigation" },
|
||||
{ id: "navigation-routine-source", category: "navigation", titleKey: "settings.routineSourceOpenMode", descriptionKey: "settings.routineSourceOpenModeDescription", targetId: "navigation" },
|
||||
|
||||
Reference in new issue
Block a user