Files
MyGoNavi/frontend/src/components/tableDataDangerActions.test.ts
Syngnat b880b5416f 🐛 fix(connection): 修复 IRIS 连接类型保存后回退为 MySQL
- 将 IRIS 纳入前端连接类型白名单与默认端口配置

- 补齐常见数据源类型别名归一化,避免未知别名回退为 MySQL

- 增加 IRIS 连接保存、导入、自动 Limit 和表数据清空回归测试

- 补齐前后端 IRIS truncate 支持

Refs #476
2026-05-18 20:14:31 +08:00

23 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { supportsTableTruncateAction } from './tableDataDangerActions';
describe('tableDataDangerActions', () => {
it('supports native truncate for known relational dialects', () => {
expect(supportsTableTruncateAction('mysql')).toBe(true);
expect(supportsTableTruncateAction('oceanbase')).toBe(true);
expect(supportsTableTruncateAction('postgres')).toBe(true);
expect(supportsTableTruncateAction('opengauss')).toBe(true);
expect(supportsTableTruncateAction('iris')).toBe(true);
expect(supportsTableTruncateAction('custom', 'postgresql')).toBe(true);
expect(supportsTableTruncateAction('custom', 'kingbase8')).toBe(true);
expect(supportsTableTruncateAction('custom', 'intersystemsiris')).toBe(true);
});
it('rejects truncate for unsupported or document-style backends', () => {
expect(supportsTableTruncateAction('sqlite')).toBe(false);
expect(supportsTableTruncateAction('mongodb')).toBe(false);
expect(supportsTableTruncateAction('custom', 'sqlite3')).toBe(false);
});
});