import type { RecordEngagementOutput } from '@core/analytics/application/use-cases/RecordEngagementUseCase';
import { beforeEach, describe, expect, it } from 'vitest';
import { RecordEngagementPresenter } from './RecordEngagementPresenter';

describe('RecordEngagementPresenter', () => {
  let presenter: RecordEngagementPresenter;

  beforeEach(() => {
    presenter = new RecordEngagementPresenter();
  });

  it('maps output to DTO correctly', () => {
    const output: RecordEngagementOutput = {
      eventId: 'event-123',
      engagementWeight: 10,
    };

    presenter.transform(output);

    expect(presenter.responseModel).toEqual({
      eventId: 'event-123',
      engagementWeight: 10,
    });
  });

  it('responseModel throws if not transformed', () => {
    expect(() => presenter.responseModel).toThrow('Presenter not transformed');
  });
});
