mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-30 00:19:35 +00:00
fix(sidebar): refresh grouped object nodes
This commit is contained in:
+15
-1
@@ -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",
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user