/** * Integration Test: DatabaseManager * * Tests the DatabaseManager infrastructure for database operations */ import { describe, it, expect } from 'vitest'; import { setupHarnessTest } from '../HarnessTestContext'; describe('DatabaseManager - Infrastructure Tests', () => { const context = setupHarnessTest(); describe('Query Execution', () => { it('should execute simple SELECT query', async () => { const result = await context.db.query('SELECT 1 as test_value'); expect(result.rows[0].test_value).toBe(1); }); it('should execute query with parameters', async () => { const result = await context.db.query('SELECT $1 as param_value', ['test']); expect(result.rows[0].param_value).toBe('test'); }); }); describe('Transaction Handling', () => { it('should begin, commit and rollback transactions', async () => { // These methods should not throw await context.db.begin(); await context.db.commit(); await context.db.begin(); await context.db.rollback(); expect(true).toBe(true); }); }); describe('Table Operations', () => { it('should truncate all tables', async () => { // This verifies the truncate logic doesn't have syntax errors await context.db.truncateAllTables(); expect(true).toBe(true); }); }); });