Files
gridpilot.gg/tests/integration/leagues/creation/league-create-edge-cases.test.ts
Marc Mintel 6df38a462a
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
integration tests
2026-01-23 11:44:59 +01:00

40 lines
1.4 KiB
TypeScript

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([]);
});
});