fix(ui): keep driver store/settings page switching and tab active state (#7035)

This commit is contained in:
zipg authored and t8y2 committed 2026-08-24 14:34:59 +08:00
1 parent 0efce9e9a9
commit c8dbeeaf7d
6 files changed
+50 -13

No files matched your search

@@ -5,6 +5,14 @@ const appSource = readFileSync(new URL("../../../App.vue", import.meta.url), "ut
const settingsDialogSource = readFileSync(new URL("../../../components/editor/EditorSettingsDialog.vue", import.meta.url), "utf8");
describe("settings page navigation", () => {
it("keeps query, settings, and driver-manager surfaces mutually exclusive", () => {
expect(appSource).toContain('type MainContentSurface = "query" | "settings" | "driverStore";');
expect(appSource).toMatch(/function activateMainContentSurface\(surface: MainContentSurface\) \{\s*settingsStore\.settingsPageActive = surface === "settings";\s*driverStoreActive\.value = surface === "driverStore";/);
expect(appSource).toMatch(/function activateSettingsPage\(\) \{\s*settingsPageTabOpen\.value = true;\s*activateMainContentSurface\("settings"\);/);
expect(appSource).toMatch(/function activateQuerySurface\(\) \{\s*activateMainContentSurface\("query"\);/);
expect(appSource).toMatch(/driverStoreTabOpen\.value = true;\s*activateMainContentSurface\("driverStore"\);/);
});
it("replays repeated navigation requests for the same tab", () => {
expect(appSource).toContain("settingsNavigationRequestId.value += 1");
expect(appSource).toContain(':navigation-request-id="settingsNavigationRequestId"');