import secondToTimeConverter from './secondToTime.js';

describe('secondToTimeConverter', () => {
  test('converts 0 seconds correctly', () => {
    expect(secondToTimeConverter(0)).toBe('00:00:00');
  });

  test('converts 60 seconds to 1 minute', () => {
    expect(secondToTimeConverter(60)).toBe('00:01:00');
  });

  test('converts 3600 seconds to 1 hour', () => {
    expect(secondToTimeConverter(3600)).toBe('01:00:00');
  });

  test('converts 3661 seconds correctly', () => {
    expect(secondToTimeConverter(3661)).toBe('01:01:01');
  });

  test('converts 7200 seconds to 2 hours', () => {
    expect(secondToTimeConverter(7200)).toBe('02:00:00');
  });

  test('converts 3599 seconds correctly', () => {
    expect(secondToTimeConverter(3599)).toBe('00:59:59');
  });

  test('converts 86400 seconds (24 hours) correctly', () => {
    expect(secondToTimeConverter(86400)).toBe('24:00:00');
  });

  test('converts 1 second correctly', () => {
    expect(secondToTimeConverter(1)).toBe('00:00:01');
  });

  test('converts 59 seconds correctly', () => {
    expect(secondToTimeConverter(59)).toBe('00:00:59');
  });

  test('converts 3723 seconds (1h 2m 3s) correctly', () => {
    expect(secondToTimeConverter(3723)).toBe('01:02:03');
  });

  test('pads single digit hours', () => {
    expect(secondToTimeConverter(3600 * 5)).toBe('05:00:00');
  });

  test('pads single digit minutes', () => {
    expect(secondToTimeConverter(60 * 5)).toBe('00:05:00');
  });

  test('pads single digit seconds', () => {
    expect(secondToTimeConverter(5)).toBe('00:00:05');
  });

  test('handles large numbers correctly', () => {
    expect(secondToTimeConverter(359999)).toBe('99:59:59');
  });

  test('converts 120 seconds to 2 minutes', () => {
    expect(secondToTimeConverter(120)).toBe('00:02:00');
  });
});
