import { describe, expect, it } from 'vitest';
import { dataQualityRunSchema } from '../schema';
const valid = {
    runId: '550e8400-e29b-41d4-a716-446655440001',
    source: 'KRX',
    session: '2026-08-01',
    status: 'PASS',
    rowCount: 100,
    failedRows: 0,
    sourceWatermark: 'KRX:2026-08-01',
    datasetId: 'dataset-1',
    contentHash: 'hash-1',
    completedAt: '2026-08-01T09:00:00Z'
};
describe('data quality contract', () => {
    it('accepts a valid run', () => {
        expect(dataQualityRunSchema.safeParse(valid).success).toBe(true);
    });
    it('rejects failed rows greater than total rows', () => {
        expect(dataQualityRunSchema.safeParse({ ...valid, failedRows: 101 }).success).toBe(false);
    });
});
