import { MessageSentEvent } from '../events/message-sent.event';

describe('Messaging Domain', () => {
  describe('MessageSentEvent', () => {
    it('creates event with correct eventName', () => {
      const event = new MessageSentEvent('msg-1', 'conv-1', 'user-1', 'TEXT', 'Hello!');

      expect(event.eventName).toBe('message.sent');
      expect(event.aggregateId).toBe('msg-1');
      expect(event.messageId).toBe('msg-1');
      expect(event.conversationId).toBe('conv-1');
      expect(event.senderId).toBe('user-1');
      expect(event.type).toBe('TEXT');
      expect(event.content).toBe('Hello!');
      expect(event.occurredAt).toBeInstanceOf(Date);
    });
  });
});
