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

describe('CreateTeamViewModel', () => {
  it('maps id and success from DTO', () => {
    const dto = { id: 'team-123', success: true };

    const vm = new CreateTeamViewModel(dto);

    expect(vm.id).toBe('team-123');
    expect(vm.success).toBe(true);
  });

  it('returns success successMessage when creation succeeded', () => {
    const dto = { id: 'team-1', success: true };

    const vm = new CreateTeamViewModel(dto);

    expect(vm.successMessage).toBe('Team created successfully!');
  });

  it('returns failure successMessage when creation failed', () => {
    const dto = { id: 'team-1', success: false };

    const vm = new CreateTeamViewModel(dto);

    expect(vm.successMessage).toBe('Failed to create team.');
  });
});
