fix(bigquery): allow external JDBC driver selection

Closes #5534
This commit is contained in:
t8y2 committed 2026-08-09 17:20:52 +08:00
1 parent 9e3013adf9
commit 8f597a0516
2 files changed
+33 -4

No files matched your search

@@ -0,0 +1,18 @@
import { readFileSync } from "node:fs";
import { describe, expect, it } from "vitest";
const dialogSource = readFileSync(new URL("../../../components/connection/ConnectionDialog.vue", import.meta.url), "utf8");
describe("BigQuery connection dialog", () => {
it("exposes and persists external JDBC driver configuration", () => {
const nativeAgentDriverSupport = dialogSource.match(/function supportsNativeAgentJdbcDriverConfigType\(dbType: DatabaseType\): boolean \{([\s\S]*?)\}/)?.[1] ?? "";
const jdbcBackedDatabaseTypes = dialogSource.match(/const jdbcBackedDatabaseTypes = new Set<DatabaseType>\(\[([\s\S]*?)\]\);/)?.[1] ?? "";
expect(nativeAgentDriverSupport).toContain('dbType === "bigquery"');
expect(jdbcBackedDatabaseTypes).toContain('"bigquery"');
expect(dialogSource).toContain("const supportsNativeAgentJdbcDriverConfig = computed(() => supportsNativeAgentJdbcDriverConfigType(form.value.db_type));");
expect(dialogSource).toContain('<template v-if="supportsNativeAgentJdbcDriverConfig">');
expect(dialogSource).toContain('if (profile.type === "bigquery") {');
expect(dialogSource).toContain("jdbcManualClasspathOpen.value = true;");
});
});