fix(diff): use connection tree select in compare dialogs

This commit is contained in:
hanxuanyu authored and GitHub committed 2026-09-02 14:12:35 +08:00
1 parent f9f61cf397
commit a1f54cf428
4 files changed
+46 -86

No files matched your search

@@ -4,6 +4,8 @@ import { describe, expect, it } from "vitest";
const searchableSelectSource = readFileSync(new URL("../../../components/ui/searchable-select/SearchableSelect.vue", import.meta.url), "utf8");
const dataTransferDialogSource = readFileSync(new URL("../../../components/transfer/DataTransferDialog.vue", import.meta.url), "utf8");
const editorToolbarSource = readFileSync(new URL("../../../components/layout/EditorToolbar.vue", import.meta.url), "utf8");
const schemaDiffConfigStepSource = readFileSync(new URL("../../../components/diff/SchemaDiffConfigStep.vue", import.meta.url), "utf8");
const dataCompareDialogSource = readFileSync(new URL("../../../components/diff/DataCompareDialog.vue", import.meta.url), "utf8");
describe("SearchableSelect layout", () => {
it("keeps slotted option labels inside a shrinkable overflow boundary", () => {
@@ -31,4 +33,14 @@ describe("SearchableSelect layout", () => {
expect(editorToolbarSource).toContain(':connections="connectionStore.connections"');
expect(editorToolbarSource).toContain(':layout="connectionStore.sidebarLayout"');
});
it.each([
["schema compare", schemaDiffConfigStepSource],
["data compare", dataCompareDialogSource],
])("renders %s connection pickers as sidebar-like trees", (_name, source) => {
expect(source.match(/<ConnectionTreeSelect/g) ?? []).toHaveLength(2);
expect(source).toContain(':connections="sqlConnections"');
expect(source).toContain(':layout="store.sidebarLayout"');
expect(source).not.toContain("ConnectionGroupBadge");
});
});