Files
gridpilot.gg/tests/integration/harness/infrastructure/database-manager.test.ts
Marc Mintel a0f41f242f
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m51s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
integration tests
2026-01-23 00:46:34 +01:00

44 lines
1.3 KiB
TypeScript

/**
* 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);
});
});
});