feat: refactor calendar

This commit is contained in:
doprz
2024-03-06 15:12:40 -06:00
parent 745f9dd6fb
commit 28f192472b
11 changed files with 251 additions and 236 deletions

View File

@@ -0,0 +1,26 @@
import { describe, expect, it } from 'vitest';
import { formatToHHMMSS } from './utils';
describe('formatToHHMMSS', () => {
it('should format minutes to HHMMSS format', () => {
const minutes = 125;
const expected = '020500';
const result = formatToHHMMSS(minutes);
expect(result).toBe(expected);
});
it('should handle single digit minutes', () => {
const minutes = 5;
const expected = '000500';
const result = formatToHHMMSS(minutes);
expect(result).toBe(expected);
});
it('should handle zero minutes', () => {
const minutes = 0;
const expected = '000000';
const result = formatToHHMMSS(minutes);
expect(result).toBe(expected);
});
});