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

describe('LeagueAdminRosterMemberViewModel', () => {
  it('requires and exposes expected fields', () => {
    const vm: LeagueAdminRosterMemberViewModel = {
      driverId: 'driver-1',
      driverName: 'Driver One',
      role: 'member',
      joinedAtIso: '2025-01-02T03:04:05.000Z',
    };

    expect(vm.driverId).toBe('driver-1');
    expect(vm.driverName).toBe('Driver One');
    expect(vm.role).toBe('member');
    expect(vm.joinedAtIso).toBe('2025-01-02T03:04:05.000Z');

    expect(typeof vm.driverId).toBe('string');
    expect(typeof vm.driverName).toBe('string');
    expect(typeof vm.joinedAtIso).toBe('string');
  });

  it('keeps role values stable as MembershipRole', () => {
    const roles: LeagueAdminRosterMemberViewModel['role'][] = ['owner', 'admin', 'steward', 'member'];

    expect(roles).toEqual(['owner', 'admin', 'steward', 'member']);
  });
});