import { validateBankAccountNumber } from './validateBankAccountNumber';

describe('validateBankAccountNumber', () => {
  it('returns true for a CLABE with a correct check digit', () => {
    expect(validateBankAccountNumber('002010077777777771')).toBe(true);
  });

  it('returns false when the check digit is wrong', () => {
    expect(validateBankAccountNumber('002010077777777772')).toBe(false);
  });

  it('returns false when the length is not 18 digits', () => {
    expect(validateBankAccountNumber('')).toBe(false);
    expect(validateBankAccountNumber('00201007777777777')).toBe(false);
    expect(validateBankAccountNumber('0020100777777777712')).toBe(false);
  });

  it('returns false when the string contains non-numeric characters', () => {
    expect(validateBankAccountNumber('00201007777777777a')).toBe(false);
    expect(validateBankAccountNumber('002 01007777777771')).toBe(false);
  });
});
