import { describe, it, expect } from 'vitest';
import { sanitizeFilename } from '../exportUtils';

describe('sanitizeFilename', () => {
  it('removes special characters', () => {
    expect(sanitizeFilename('Room #1 (Main)')).toBe('Room_1_Main');
  });

  it('replaces spaces with underscores', () => {
    expect(sanitizeFilename('My Room')).toBe('My_Room');
  });

  it('collapses multiple spaces', () => {
    expect(sanitizeFilename('Room   Name')).toBe('Room_Name');
  });

  it('preserves hyphens and underscores', () => {
    expect(sanitizeFilename('room-1_main')).toBe('room-1_main');
  });

  it('handles empty string', () => {
    expect(sanitizeFilename('')).toBe('');
  });

  it('handles string with only special characters', () => {
    expect(sanitizeFilename('!@#$%')).toBe('');
  });
});
