fix(sql-library): preserve folders during directory import

Closes #5877
This commit is contained in:
t8y2 committed 2026-08-11 17:03:10 +08:00
1 parent d71091f262
commit 8482ef25ec
4 files changed
+101 -18

No files matched your search

+10
View File
@@ -22,6 +22,16 @@ test("SQL library directory imports use the native pruned folder scanner", () =>
assert.doesNotMatch(scanner, /@tauri-apps\/plugin-fs|readDir/);
});
test("SQL library directory imports preserve nested folder paths", () => {
const start = source.indexOf("async function importDirectoryIntoLibrary");
const end = source.indexOf("async function chooseSyncDirectory", start);
const handler = start >= 0 && end > start ? source.slice(start, end) : "";
assert.match(handler, /resolveImportedFolder\(connectionId, targetFolder\?\.id, file\.folderNames, folderCache\)/);
assert.match(handler, /uniqueImportedName\(file\.name, takenNames\)/);
assert.doesNotMatch(handler, /relativeImportName/);
});
test("SQL library file menu can open a file with the current tab target", () => {
assert.match(source, /label: t\("sqlLibrary\.openInCurrentDatabase"\)/);
assert.match(source, /action: \(\) => openFile\(target, "current"\)/);