This commit is contained in:
2025-12-17 01:23:09 +01:00
parent f01e01e50c
commit 4d890863d3
73 changed files with 2632 additions and 3224 deletions

View File

@@ -0,0 +1,32 @@
import { describe, it, expect } from 'vitest';
import { TrackGameId } from './TrackGameId';
describe('TrackGameId', () => {
it('should create track game id', () => {
const id = TrackGameId.create('123');
expect(id.toString()).toBe('123');
expect(id.props).toBe('123');
});
it('should trim whitespace', () => {
const id = TrackGameId.create(' 123 ');
expect(id.toString()).toBe('123');
});
it('should throw for empty id', () => {
expect(() => TrackGameId.create('')).toThrow('Track game ID cannot be empty');
expect(() => TrackGameId.create(' ')).toThrow('Track game ID cannot be empty');
});
it('should equal same ids', () => {
const i1 = TrackGameId.create('123');
const i2 = TrackGameId.create('123');
expect(i1.equals(i2)).toBe(true);
});
it('should not equal different ids', () => {
const i1 = TrackGameId.create('123');
const i2 = TrackGameId.create('456');
expect(i1.equals(i2)).toBe(false);
});
});