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 { TrackCountry } from './TrackCountry';
describe('TrackCountry', () => {
it('should create track country', () => {
const country = TrackCountry.create('USA');
expect(country.toString()).toBe('USA');
expect(country.props).toBe('USA');
});
it('should trim whitespace', () => {
const country = TrackCountry.create(' USA ');
expect(country.toString()).toBe('USA');
});
it('should throw for empty country', () => {
expect(() => TrackCountry.create('')).toThrow('Track country is required');
expect(() => TrackCountry.create(' ')).toThrow('Track country is required');
});
it('should equal same countries', () => {
const c1 = TrackCountry.create('USA');
const c2 = TrackCountry.create('USA');
expect(c1.equals(c2)).toBe(true);
});
it('should not equal different countries', () => {
const c1 = TrackCountry.create('USA');
const c2 = TrackCountry.create('UK');
expect(c1.equals(c2)).toBe(false);
});
});