fix(tabs): hide database label for connection-only targets

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-09-23 14:43:43 +08:00
1 parent 13d2db6191
commit ebb2c1006e
4 files changed
+43 -3

No files matched your search

@@ -322,6 +322,24 @@ describe("tab group presentation", () => {
]);
});
it("omits the database row from tooltips for connections without a database target", () => {
const store = useConnectionStore();
store.sidebarLayout = {
groups: [],
order: [{ type: "connection", id: "conn-1" }],
};
for (const dbType of ["dynamodb", "elasticsearch", "easysearch", "meilisearch", "solr", "qdrant", "weaviate", "chromadb", "etcd", "zookeeper", "nacos", "consul", "mq", "mqtt", "victoriametrics"] as const) {
store.connections = [{ id: "conn-1", name: "Local", db_type: dbType, database: "default" } as ConnectionConfig];
const lines = tabTooltipLines(queryTab({ database: "default" }), translate);
expect(lines, dbType).toContainEqual({ label: "Connection:", value: "Local" });
expect(lines, dbType).toContainEqual({ label: "Group:", value: "Ungrouped" });
expect(lines, dbType).not.toContainEqual({ label: "Database:", value: "default" });
}
});
it("labels a top-level connection as ungrouped", () => {
const store = useConnectionStore();
store.connections = [{ id: "conn-1", name: "PostgreSQL", db_type: "postgres", database: "app" } as ConnectionConfig];