import convertHHMMSSToHHMM from './ConvertHHMMSStoHHMM';

describe('ConvertHHMMSStoHHMM', () => {
  test('should convert time format from HH:MM:SS to HH:MM', async () => {
    const result = await convertHHMMSSToHHMM('01:30:45');
    expect(result).toBe('01:30');
  });

  test('should handle 00:00:00', async () => {
    const result = await convertHHMMSSToHHMM('00:00:00');
    expect(result).toBe('00:00');
  });

  test('should handle large hours', async () => {
    const result = await convertHHMMSSToHHMM('23:59:59');
    expect(result).toBe('23:59');
  });

  test('should handle time with leading zeros', async () => {
    const result = await convertHHMMSSToHHMM('09:08:07');
    expect(result).toBe('09:08');
  });

  test('should return same format when appropriate', async () => {
    const result = await convertHHMMSSToHHMM('12:34:00');
    expect(result).toBe('12:34');
  });
});
