feat: refactor calendar
This commit is contained in:
26
src/views/components/calendar/utils.test.ts
Normal file
26
src/views/components/calendar/utils.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user