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

describe('TeamTag', () => {
  it('should create team tag', () => {
    const tag = TeamTag.create('TAG123');
    expect(tag.toString()).toBe('TAG123');
    expect(tag.props).toBe('TAG123');
  });

  it('should trim whitespace', () => {
    const tag = TeamTag.create('  TAG  ');
    expect(tag.toString()).toBe('TAG');
  });

  it('should throw for empty tag', () => {
    expect(() => TeamTag.create('')).toThrow('Team tag is required');
    expect(() => TeamTag.create('   ')).toThrow('Team tag is required');
  });

  it('should equal same tags', () => {
    const t1 = TeamTag.create('TAG1');
    const t2 = TeamTag.create('TAG1');
    expect(t1.equals(t2)).toBe(true);
  });

  it('should not equal different tags', () => {
    const t1 = TeamTag.create('TAG1');
    const t2 = TeamTag.create('TAG2');
    expect(t1.equals(t2)).toBe(false);
  });
});