fix(sidebar): refresh grouped object nodes

This commit is contained in:
t8y2
2026-05-13 18:12:55 +08:00
parent df574c78a5
commit cb00b27963
3 changed files with 42 additions and 2 deletions
+15 -1
View File
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import test from "node:test";
import { buildTableTreeNodes, expandCachedObjectBrowserNodes } from "../src/lib/tableTree.ts";
import { buildTableTreeNodes, expandCachedObjectBrowserNodes, objectGroupRefreshParentId } from "../src/lib/tableTree.ts";
import type { TableInfo } from "../src/types/database.ts";
function table(name: string, tableType: "TABLE" | "VIEW" = "TABLE"): TableInfo {
@@ -82,3 +82,17 @@ test("expands cached object-browser nodes back into regular table nodes", () =>
],
);
});
test("resolves grouped object refreshes to the parent schema node", () => {
assert.equal(
objectGroupRefreshParentId({
id: "conn:db:public:__tables",
label: "tree.tables",
type: "group-tables",
connectionId: "conn",
database: "db",
schema: "public",
}),
"conn:db:public",
);
});