Add more tests for UUID validation
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 25 Oct 2022 23:36:24 +0000 (01:36 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 25 Oct 2022 23:36:24 +0000 (01:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
test/utils/UtilsTest.ts

index 9e882cc5e63a3dd4969bd86967acdb48a4e3e41f..5982e198e290312f4ac659a3510fc25cbb749c13 100644 (file)
@@ -7,6 +7,9 @@ describe('Utils test suite', () => {
     const uuid = Utils.generateUUID();
     expect(uuid.length).toEqual(36);
     expect(Utils.validateUUID(uuid)).toBe(true);
+    expect(Utils.validateUUID('abcdef00-0000-4000-0000-000000000000')).toBe(true);
+    expect(Utils.validateUUID('')).toBe(false);
+    expect(Utils.validateUUID('987FBC9-4BED-3078-CF07A-9141BA07C9F3')).toBe(false);
   });
 
   it('Verify secureRandom()', () => {