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

describe('UpdateTeamViewModel', () => {
  it('maps success from DTO', () => {
    const dto = { success: true };

    const vm = new UpdateTeamViewModel(dto);

    expect(vm.success).toBe(true);
  });

  it('returns success successMessage when update succeeded', () => {
    const dto = { success: true };

    const vm = new UpdateTeamViewModel(dto);

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

  it('returns failure successMessage when update failed', () => {
    const dto = { success: false };

    const vm = new UpdateTeamViewModel(dto);

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