mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-28 16:09:17 +00:00
fix(sidebar): preserve expansion after object rename
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import test from "node:test";
|
||||
|
||||
const treeItemSource = readFileSync(join(process.cwd(), "apps/desktop/src/components/sidebar/TreeItem.vue"), "utf8");
|
||||
|
||||
function extractRefreshTableListBody(): string {
|
||||
const match = treeItemSource.match(/async function refreshTableList\(node: TreeNode\) \{([\s\S]*?)\n\}/);
|
||||
assert.ok(match, "TreeItem.vue should define refreshTableList");
|
||||
return match[1]!;
|
||||
}
|
||||
|
||||
test("object mutations refresh through the expansion-preserving object list path", () => {
|
||||
const body = extractRefreshTableListBody();
|
||||
|
||||
assert.match(body, /refreshObjectListTreeNode/);
|
||||
assert.doesNotMatch(body, /loadTables\(/);
|
||||
assert.doesNotMatch(body, /loadSqlServerDatabaseObjects\(/);
|
||||
});
|
||||
Reference in New Issue
Block a user