import type { RecordPageViewOutput } from '@core/analytics/application/use-cases/RecordPageViewUseCase';
import { beforeEach, describe, expect, it } from 'vitest';
import { RecordPageViewPresenter } from './RecordPageViewPresenter';

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

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

  it('maps output to DTO correctly', () => {
    const output: RecordPageViewOutput = {
      pageViewId: 'pv-123',
    };

    presenter.transform(output);

    expect(presenter.responseModel).toEqual({
      pageViewId: 'pv-123',
    });
  });

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