Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

1.5 KB
Raw Blame
import { describe, expect, it } from "vitest";
import { CONNECTION_PICKER_OPTIONS, CONNECTION_PROFILES, CONNECTION_PROFILE_ICONS } from "@/types/generated/connectionProfiles";

describe("generated connection profiles", () => {
  it("keeps picker options unique and backed by profiles", () => {
    const optionIds = CONNECTION_PICKER_OPTIONS.map((option) => option.value);
    expect(new Set(optionIds).size).toBe(optionIds.length);
    expect(optionIds.every((id) => id in CONNECTION_PROFILES)).toBe(true);
  });

  it("preserves compatible products and specialized protocol defaults", () => {
    expect(CONNECTION_PROFILES.mariadb).toMatchObject({ type: "mysql", port: 3306, user: "root" });
    expect(CONNECTION_PROFILES.rabbitmq).toMatchObject({ type: "mq", port: 5672, host: "127.0.0.1" });
    expect(CONNECTION_PROFILES.nacos).toMatchObject({ type: "nacos", port: 8848, user: "nacos" });
    expect(CONNECTION_PROFILES.argo).toMatchObject({ type: "argo", urlParams: "auth=noSasl" });
  });

  it("keeps internal variants out of the main picker", () => {
    const optionIds = new Set(CONNECTION_PICKER_OPTIONS.map((option) => option.value));
    expect(optionIds.has("mongodb-legacy")).toBe(false);
    expect(optionIds.has("oceanbase-oracle")).toBe(false);
    expect(optionIds.has("h2-legacy")).toBe(false);
  });

  it("preserves picker-specific icon overrides", () => {
    expect(CONNECTION_PROFILE_ICONS.mq).toBe("mq");
    expect(CONNECTION_PROFILE_ICONS.prestosql).toBe("prestosql");
    expect(CONNECTION_PROFILE_ICONS.influxdb).toBe("influxdb");
  });
});