Skip to content

Commit

Permalink
chore: add more unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov committed Feb 8, 2024
1 parent e164f49 commit 0175c21
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@ describe('DateTime (maskitoTransform) | Pseudo date end separators', () => {
});

it('replaces space with valid date end separator', () => {
expect(maskitoTransform('01012000 ', options)).toBe(
`01.01.2000${DATE_TIME_SEPARATOR}`,
);
expect(maskitoTransform('01012000 2359', options)).toBe(
`01.01.2000${DATE_TIME_SEPARATOR}23:59`,
);
});

it('replaces comma with valid range separator', () => {
expect(maskitoTransform('01012000,', options)).toBe(
`01.01.2000${DATE_TIME_SEPARATOR}`,
);
expect(maskitoTransform('01012000,235959999', options)).toBe(
`01.01.2000${DATE_TIME_SEPARATOR}23:59:59.999`,
);
});

it('does not add anything if separator does not initially exist', () => {
expect(maskitoTransform('01012000', options)).toBe('01.01.2000');
});
});

0 comments on commit 0175c21

Please sign in to comment.