Files
kaptan/ground-suite/src/core/data-plane/eventValidation.test.ts
T
Onur Özkan 6e15063502 save
Signed-off-by: Onur Özkan <work@onurozkan.dev>
2026-08-17 18:51:40 +03:00

10 lines
479 B
TypeScript

import { describe, expect, it } from 'vitest';
import { validateEvent } from './eventValidation';
describe('event validation', () => {
it.each([
[{}, 'Unsupported event schema'],
[{ schemaVersion: 1 }, 'Missing envelope identity'],
[{ schemaVersion: 1, eventId: 'a', streamId: 's', entity: {}, sequence: -1 }, 'Invalid monotonic sequence'],
])('rejects malformed envelopes', (value, reason) => expect(validateEvent(value)).toEqual({ valid: false, reason }));
});