feat(connection): 支持导入Navicat NCX连接

This commit is contained in:
Syngnat
2026-06-29 14:16:17 +08:00
parent 8280306f82
commit c940e930bc
9 changed files with 32 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
import { beforeEach, describe, expect, it } from 'vitest';
import { setCurrentLanguage } from '../i18n';
import { setCurrentLanguage, t } from '../i18n';
import {
detectConnectionImportKind,
isConnectionPackagePasswordRequiredError,
@@ -104,6 +104,10 @@ describe('connectionExport', () => {
</Connections>`)).toBe('navicat-ncx');
});
it('mentions Navicat NCX in unsupported import format guidance', () => {
expect(t('app.connection_package.message.unsupported_file_format', undefined, 'zh-CN')).toContain('Navicat NCX');
});
it('returns invalid for malformed or unsupported content', () => {
expect(detectConnectionImportKind('{not-json}')).toBe('invalid');
expect(detectConnectionImportKind(JSON.stringify({