import { describe, it, expect } from 'vitest';
import { formatAddress } from './format-address.helper';

describe('formatAddress', () => {
  it('should format complete address correctly', () => {
    const address = {
      street: 'Main Street',
      streetNumber: '123',
      zipCode: '12345',
      city: 'Berlin',
    };

    const result = formatAddress(address);

    expect(result).toBe('Main Street 123 | 12345 Berlin');
  });

  it('should handle missing street number', () => {
    const address = {
      street: 'Main Street',
      zipCode: '12345',
      city: 'Berlin',
    };

    const result = formatAddress(address);

    expect(result).toBe('Main Street | 12345 Berlin');
  });

  it('should return undefined for undefined address', () => {
    const result = formatAddress(undefined);

    expect(result).toBeUndefined();
  });
});
