mirror of
https://github.com/iritmaximus/workh.git
synced 2026-10-12 19:13:33 +03:00
[HourInput] Read 7.15 as 7h15min, not 7h9min
This commit is contained in:
@@ -35,7 +35,11 @@ const fullWeek = (minutes: number) =>
|
||||
describe('parseDuration', () => {
|
||||
it.each([
|
||||
['7.5', 450],
|
||||
['7,25', 435],
|
||||
['7,5', 450],
|
||||
['7.15', 435],
|
||||
['7,15', 435],
|
||||
['7.45', 465],
|
||||
['7.05', 425],
|
||||
['7:15', 435],
|
||||
['7h15', 435],
|
||||
['7h 15min', 435],
|
||||
@@ -45,7 +49,9 @@ describe('parseDuration', () => {
|
||||
['8', 480],
|
||||
])('%s -> %i', (input, expected) => expect(parseDuration(input)).toBe(expected));
|
||||
|
||||
it.each(['', 'abc', '7:75', '7h99'])('rejects %j', (input) => expect(parseDuration(input)).toBeNull());
|
||||
it.each(['', 'abc', '7:75', '7h99', '7.75', '7.123'])('rejects %j', (input) =>
|
||||
expect(parseDuration(input)).toBeNull(),
|
||||
);
|
||||
});
|
||||
|
||||
describe('formatting', () => {
|
||||
|
||||
Reference in New Issue
Block a user