mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 09:13:24 +00:00
ENH - clock app
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
formatStopwatch,
|
||||
formatTimer,
|
||||
remainingMilliseconds,
|
||||
timerProgressRatio,
|
||||
timerPickerMilliseconds,
|
||||
timerPickerValue,
|
||||
} from './clock'
|
||||
@@ -23,4 +24,11 @@ describe('timestamp clocks', () => {
|
||||
it('formats stopwatch durations with actual milliseconds', () => {
|
||||
expect(formatStopwatch(61_234)).toBe('01:01.234')
|
||||
})
|
||||
|
||||
it('calculates bounded timer progress from remaining duration', () => {
|
||||
expect(timerProgressRatio(7_500, 10_000)).toBe(0.75)
|
||||
expect(timerProgressRatio(-1, 10_000)).toBe(0)
|
||||
expect(timerProgressRatio(12_000, 10_000)).toBe(1)
|
||||
expect(timerProgressRatio(0, 0)).toBe(0)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user