Files
WebApp/src/app/connect/domain/sql-url.spec.ts
T

13 lines
692 B
TypeScript

import { describeSqlServer, describeSqlUrl } from './sql-url';
describe('sql-url', () => {
const mssql = { id: 'mssql', label: 'SQL Server', description: '', default_port: 1433, default_schema: 'dbo', available: true };
it('never puts the password in what the UI shows', () => {
const settings = { engine: mssql, host: '10.0.10.41', port: null, database: 'his', user: 'lector', password: 'p@ss:w/rd' };
expect(describeSqlServer(settings)).toBe('his · lector@10.0.10.41:1433');
expect(describeSqlUrl('mysql+pymysql://u:secret@db.local:3307/hospital_legacy')).toBe('hospital_legacy · db.local:3307');
expect(describeSqlUrl('not a url')).toBe('Base de datos');
});
});