mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-15 10:59:41 +08:00
- 前端连接弹窗新增 Elasticsearch 入口、默认端口、URI 示例和默认索引配置 - 补齐 Elasticsearch 图标、数据源能力、SQL dialect 和只读查询策略 - 后端驱动管理注册 Elasticsearch 版本、模块路径、构建标签和默认安装入口 - 增加连接展示、能力识别和驱动定义测试覆盖
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
|
|
import { DB_ICON_TYPES, getDbIcon, getDbIconLabel } from './DatabaseIcons';
|
|
|
|
describe('DatabaseIcons', () => {
|
|
it('includes InterSystems IRIS in the selectable database icons', () => {
|
|
expect(DB_ICON_TYPES).toContain('iris');
|
|
expect(getDbIconLabel('iris')).toBe('InterSystems IRIS');
|
|
});
|
|
|
|
it('includes Elasticsearch in the selectable database icons', () => {
|
|
expect(DB_ICON_TYPES).toContain('elasticsearch');
|
|
expect(getDbIconLabel('elasticsearch')).toBe('Elasticsearch');
|
|
expect(renderToStaticMarkup(<>{getDbIcon('elasticsearch', undefined, 22)}</>)).toContain('ES');
|
|
});
|
|
|
|
it('wraps database icons in a consistent frame for sidebar sizing', () => {
|
|
const mysqlMarkup = renderToStaticMarkup(<>{getDbIcon('mysql', undefined, 22)}</>);
|
|
const jvmMarkup = renderToStaticMarkup(<>{getDbIcon('jvm', undefined, 22)}</>);
|
|
|
|
expect(mysqlMarkup).toContain('data-db-icon-frame="true"');
|
|
expect(jvmMarkup).toContain('data-db-icon-frame="true"');
|
|
expect(mysqlMarkup).toContain('width:22px');
|
|
expect(jvmMarkup).toContain('width:22px');
|
|
});
|
|
});
|