fix(transfer): show tables for supported database types

Refs: #6115
This commit is contained in:
t8y2 committed 2026-08-13 11:01:50 +00:00
1 parent f8b165fe20
commit 44cb278257
3 files changed
+39 -5

No files matched your search

@@ -47,6 +47,22 @@ describe("DataTransferDialog transfer prefill", () => {
expect(dialogSource).toContain("groups[kind] = objects.map((o) => o.name)");
});
it("routes table-only database kinds through the table-list request", () => {
expect(dialogSource).toContain("const kinds = transferObjectKindsForDatabase(config?.db_type)");
expect(dialogSource).toContain("for (const kind of kinds)");
expect(dialogSource).toContain('if (kind === "TABLE")');
expect(dialogSource).toContain("await api.listTables(sourceConnectionId.value, sourceDatabase.value, schema");
});
it("keeps MongoDB collection loading ahead of the generic object-kind path", () => {
const mongoCollectionBranch = dialogSource.indexOf("if (isMongoConnection(sourceConnectionId.value))");
const genericObjectKinds = dialogSource.indexOf("const kinds = transferObjectKindsForDatabase(config?.db_type)");
expect(mongoCollectionBranch).toBeGreaterThan(-1);
expect(dialogSource).toContain("await api.mongoListCollections(sourceConnectionId.value, sourceDatabase.value)");
expect(mongoCollectionBranch).toBeLessThan(genericObjectKinds);
});
it("disables non-table groups for data-only and cross-family transfers", () => {
expect(dialogSource).toContain("treeDisabledGroups");
expect(dialogSource).toContain('transferContent.value === "dataOnly"');