2020-04-15 18:57:57 +02:00
|
|
|
import isDicomUid from './isDicomUid';
|
|
|
|
|
|
2023-09-01 22:19:39 +02:00
|
|
|
describe('isDicomUid', function () {
|
|
|
|
|
it('should return true for valid DICOM UIDs', function () {
|
2020-04-15 18:57:57 +02:00
|
|
|
expect(isDicomUid('1')).toBe(true);
|
|
|
|
|
expect(isDicomUid('1.2')).toBe(true);
|
|
|
|
|
expect(isDicomUid('1.2.3')).toBe(true);
|
|
|
|
|
expect(isDicomUid('1.2.3.4')).toBe(true);
|
|
|
|
|
});
|
2023-09-01 22:19:39 +02:00
|
|
|
it('should return false for invalid DICOM UIDs', function () {
|
2020-04-15 18:57:57 +02:00
|
|
|
expect(isDicomUid('x')).toBe(false);
|
|
|
|
|
expect(isDicomUid('1.')).toBe(false);
|
|
|
|
|
expect(isDicomUid('1. 2')).toBe(false);
|
|
|
|
|
expect(isDicomUid('1.2.n.4')).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
});
|