mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-21 08:10:29 +08:00
- 修复自定义连接编辑时已保存 DSN 无法留空沿用的问题 - 重置 AI 供应商编辑态与清空密钥开关,避免关闭后状态残留 - 对齐浏览器 mock 复制连接的 config.id 语义并补充回归测试
27 lines
760 B
TypeScript
27 lines
760 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { duplicateBrowserMockConnection } from './browserMockConnections';
|
|
|
|
describe('duplicateBrowserMockConnection', () => {
|
|
it('rewrites config.id to match the duplicated top-level id', () => {
|
|
const duplicated = duplicateBrowserMockConnection({
|
|
existing: {
|
|
id: 'conn-1',
|
|
name: 'Primary',
|
|
config: {
|
|
id: 'conn-1',
|
|
type: 'postgres',
|
|
},
|
|
includeDatabases: ['appdb'],
|
|
},
|
|
items: [],
|
|
nextId: 'conn-2',
|
|
});
|
|
|
|
expect(duplicated.id).toBe('conn-2');
|
|
expect(duplicated.config.id).toBe('conn-2');
|
|
expect(duplicated.name).toBe('Primary - 副本');
|
|
expect(duplicated.includeDatabases).toEqual(['appdb']);
|
|
});
|
|
});
|