import { describe, it, expect, beforeEach } from 'vitest'; import { LeaguesTestContext } from '../LeaguesTestContext'; import { LeagueCreateCommand } from '../../../../core/leagues/application/ports/LeagueCreateCommand'; describe('League Creation - Edge Cases', () => { let context: LeaguesTestContext; beforeEach(() => { context = new LeaguesTestContext(); context.clear(); }); it('should handle league with empty description', async () => { const result = await context.createLeague({ description: '' }); expect(result.description).toBeNull(); }); it('should handle league with very long description', async () => { const longDescription = 'a'.repeat(2000); const result = await context.createLeague({ description: longDescription }); expect(result.description).toBe(longDescription); }); it('should handle league with special characters in name', async () => { const specialName = 'League! @#$%^&*()_+'; const result = await context.createLeague({ name: specialName }); expect(result.name).toBe(specialName); }); it('should handle league with max drivers set to 1', async () => { const result = await context.createLeague({ maxDrivers: 1 }); expect(result.maxDrivers).toBe(1); }); it('should handle league with empty track list', async () => { const result = await context.createLeague({ tracks: [] }); expect(result.tracks).toEqual([]); }); });