import { describe, it, expect } from 'vitest';
import { parseBigNummer } from './big-nummer';

describe('parseBigNummer', () => {
  it('accepts exactly 11 digits, trimming whitespace', () => {
    const r = parseBigNummer(' 12345678901 ');
    expect(r.ok).toBe(true);
    if (r.ok) expect(r.value).toBe('12345678901');
  });

  it('rejects wrong length or non-digits', () => {
    expect(parseBigNummer('').ok).toBe(false);
    expect(parseBigNummer('1234567890').ok).toBe(false); // 10 digits
    expect(parseBigNummer('123456789012').ok).toBe(false); // 12 digits
    expect(parseBigNummer('1234567890a').ok).toBe(false);
  });
});
