import { CreditsPipe } from './credits.pipe';

describe('CreditsPipe', () => {
  let pipe: CreditsPipe;

  beforeEach(() => {
    pipe = new CreditsPipe();
  });

  it('should create an instance', () => {
    expect(pipe).toBeTruthy();
  });

  it('should format credits with default max', () => {
    expect(pipe.transform(6)).toBe('6/9 créditos');
  });

  it('should format zero credits', () => {
    expect(pipe.transform(0)).toBe('0/9 créditos');
  });

  it('should format max credits', () => {
    expect(pipe.transform(9)).toBe('9/9 créditos');
  });

  it('should use custom max credits', () => {
    expect(pipe.transform(5, 12)).toBe('5/12 créditos');
  });

  it('should handle negative values', () => {
    expect(pipe.transform(-1)).toBe('-1/9 créditos');
  });
});
