From 0175c21c2b4412d7c59e1b60fc003f28384bc671 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Thu, 8 Feb 2024 11:52:27 +0300 Subject: [PATCH] chore: add more unit tests --- .../date-time/tests/pseudo-date-end-separator.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/kit/src/lib/masks/date-time/tests/pseudo-date-end-separator.spec.ts b/projects/kit/src/lib/masks/date-time/tests/pseudo-date-end-separator.spec.ts index 004e0ebed..9d6803e72 100644 --- a/projects/kit/src/lib/masks/date-time/tests/pseudo-date-end-separator.spec.ts +++ b/projects/kit/src/lib/masks/date-time/tests/pseudo-date-end-separator.spec.ts @@ -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'); + }); });