import { describe, expect, it } from 'vitest';
import { formatFileSize } from './FileSize';

describe('formatFileSize', () => {
  it('should return a string value for a file size', () => {
    const fileSize = 44525670512;

    expect(formatFileSize(fileSize)).toBe('41.47 GB');
  });

  it('should handle zero byte value', () => {
    expect(formatFileSize(0)).toBe('0 Bytes');
  });

  it('should handle null values', () => {
    // @ts-expect-error necessary for checking runtime errors
    expect(formatFileSize(null)).toBe('Invalid Value');

    // @ts-expect-error necessary for checking runtime errors
    expect(formatFileSize(undefined)).toBe('Invalid Value');
  });
});
