Files
dbx/packages/app-tests/databaseOptions.test.ts
T
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00

16 lines
721 B
TypeScript

import assert from "node:assert/strict";
import { test } from "vitest";
import { databaseOptionsForConnection } from "../../apps/desktop/src/composables/useDatabaseOptions.ts";
test("tree-schema connections include the default database when no catalogs are returned", () => {
assert.deepEqual(databaseOptionsForConnection([], { db_type: "jdbc" }), [""]);
});
test("non tree-schema connections keep an empty database option list", () => {
assert.deepEqual(databaseOptionsForConnection([], { db_type: "mysql" }), []);
});
test("database options preserve returned catalogs when available", () => {
assert.deepEqual(databaseOptionsForConnection(["app", "analytics"], { db_type: "jdbc" }), ["app", "analytics"]);
});