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

17 lines
740 B
TypeScript

import { SqlConnection, SqlQueryTable, SqlTable } from './sql-source';
describe('SqlConnection', () => {
it('sends the server settings, never a hand-built URL', async () => {
const server = { engine: 'mssql', host: 'his.local', port: null, database: 'HIS', user: 'lector', password: 'p@ss' };
const connection = new SqlConnection({ server }, 'HIS · lector@his.local:1433', 'dbo');
expect(await new SqlTable(connection, 'pacientes').locator()).toEqual({
source_type: 'sql',
payload: { server, table: 'pacientes', schema: 'dbo' },
});
expect(await new SqlQueryTable(connection, 'q', 'SELECT 1').locator()).toEqual({
source_type: 'sql',
payload: { server, query: 'SELECT 1' },
});
});
});