import { describe, expect, it } from 'vitest';
import { UpdateLeagueSeasonScheduleRacePresenter } from './LeagueSeasonScheduleMutationPresenters';

describe('UpdateLeagueSeasonScheduleRacePresenter', () => {
  it('presents update result with success=true', () => {
    const presenter = new UpdateLeagueSeasonScheduleRacePresenter();

    presenter.present({
      success: true,
    });

    const vm = presenter.getResponseModel();

    expect(vm).not.toBeNull();
    expect(vm!.success).toBe(true);
  });

  it('returns null before present is called', () => {
    const presenter = new UpdateLeagueSeasonScheduleRacePresenter();

    const vm = presenter.getResponseModel();

    expect(vm).toBeNull();
  });

  it('can be reset after presenting', () => {
    const presenter = new UpdateLeagueSeasonScheduleRacePresenter();

    presenter.present({
      success: true,
    });

    expect(presenter.getResponseModel()).not.toBeNull();

    presenter.reset();

    expect(presenter.getResponseModel()).toBeNull();
  });

  it('can present multiple times', () => {
    const presenter = new UpdateLeagueSeasonScheduleRacePresenter();

    // First presentation
    presenter.present({
      success: true,
    });

    let vm = presenter.getResponseModel();
    expect(vm!.success).toBe(true);

    // Second presentation (simulating reuse)
    presenter.present({
      success: true,
    });

    vm = presenter.getResponseModel();
    expect(vm!.success).toBe(true);
  });
});