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

describe('formatDatumNl', () => {
  it('formats a Date in long Dutch form', () => {
    expect(formatDatumNl(new Date(2026, 6, 2))).toBe('2 juli 2026');
  });

  it('formats an ISO string the same way', () => {
    expect(formatDatumNl('2026-07-02')).toBe('2 juli 2026');
  });

  it('is empty-safe: undefined, null, and empty string all yield the empty string', () => {
    expect(formatDatumNl(undefined)).toBe('');
    expect(formatDatumNl(null)).toBe('');
    expect(formatDatumNl('')).toBe('');
  });

  it('returns empty for an unparseable string rather than "Invalid Date"', () => {
    expect(formatDatumNl('not-a-date')).toBe('');
  });
});
